summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2013-08-06 11:01:04 +0100
committerBen Murdoch <benm@google.com>2013-08-06 11:01:04 +0100
commit2385ea399aae016c0806a4f9ef3c9cfe3d2a39df (patch)
treee910e76d19265ff3230c473da95410d3f3a007af /apps
parent8ee924b76946696c0f52e56d28cc5ab741919041 (diff)
downloadchromium_org-2385ea399aae016c0806a4f9ef3c9cfe3d2a39df.tar.gz
Merge from Chromium at DEPS revision r215849
This commit was generated by merge_to_master.py. Change-Id: I225a31651af894e33bdd71e7121702bcbe5310f4
Diffstat (limited to 'apps')
-rw-r--r--apps/DEPS1
-rw-r--r--apps/app_shim/extension_app_shim_handler_mac.cc4
-rw-r--r--apps/app_window_contents.cc2
-rw-r--r--apps/apps.gypi1
-rw-r--r--apps/native_app_window.h55
-rw-r--r--apps/shell_window.cc4
-rw-r--r--apps/shell_window.h6
7 files changed, 66 insertions, 7 deletions
diff --git a/apps/DEPS b/apps/DEPS
index df07d6881c..dbcf7e7124 100644
--- a/apps/DEPS
+++ b/apps/DEPS
@@ -18,7 +18,6 @@ include_rules = [
"+chrome/browser/lifetime/application_lifetime.h",
"+chrome/browser/profiles",
"+chrome/browser/sessions/session_id.h",
- "+chrome/browser/ui/extensions/native_app_window.h",
"+chrome/browser/ui/host_desktop.h",
"+chrome/common/chrome_switches.h",
"+chrome/common/extensions",
diff --git a/apps/app_shim/extension_app_shim_handler_mac.cc b/apps/app_shim/extension_app_shim_handler_mac.cc
index f663de0b8a..bf68bca96f 100644
--- a/apps/app_shim/extension_app_shim_handler_mac.cc
+++ b/apps/app_shim/extension_app_shim_handler_mac.cc
@@ -7,6 +7,7 @@
#include "apps/app_lifetime_monitor_factory.h"
#include "apps/app_shim/app_shim_host_manager_mac.h"
#include "apps/app_shim/app_shim_messages.h"
+#include "apps/native_app_window.h"
#include "apps/shell_window.h"
#include "base/files/file_path.h"
#include "base/logging.h"
@@ -20,7 +21,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/extensions/application_launch.h"
-#include "chrome/browser/ui/extensions/native_app_window.h"
#include "chrome/browser/ui/web_applications/web_app_ui.h"
#include "chrome/browser/web_applications/web_app_mac.h"
#include "content/public/browser/notification_details.h"
@@ -83,7 +83,7 @@ void ExtensionAppShimHandler::Delegate::LoadProfileAsync(
profile_manager->CreateProfileAsync(
full_path,
base::Bind(&ProfileLoadedCallback, callback),
- string16(), string16(), false);
+ string16(), string16(), std::string());
}
ShellWindowList ExtensionAppShimHandler::Delegate::GetWindows(
diff --git a/apps/app_window_contents.cc b/apps/app_window_contents.cc
index bcefa3ef8c..d163c2ce84 100644
--- a/apps/app_window_contents.cc
+++ b/apps/app_window_contents.cc
@@ -4,9 +4,9 @@
#include "apps/app_window_contents.h"
+#include "apps/native_app_window.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/extensions/native_app_window.h"
#include "chrome/common/extensions/api/app_window.h"
#include "chrome/common/extensions/extension_messages.h"
#include "content/public/browser/browser_thread.h"
diff --git a/apps/apps.gypi b/apps/apps.gypi
index 5b217b6c9a..2a1bc993ee 100644
--- a/apps/apps.gypi
+++ b/apps/apps.gypi
@@ -55,6 +55,7 @@
'field_trial_names.cc',
'field_trial_names.h',
'metrics_names.h',
+ 'native_app_window.h',
'pref_names.cc',
'pref_names.h',
'prefs.cc',
diff --git a/apps/native_app_window.h b/apps/native_app_window.h
new file mode 100644
index 0000000000..0286453441
--- /dev/null
+++ b/apps/native_app_window.h
@@ -0,0 +1,55 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef APPS_NATIVE_APP_WINDOW_H_
+#define APPS_NATIVE_APP_WINDOW_H_
+
+#include "apps/shell_window.h"
+#include "components/web_modal/web_contents_modal_dialog_host.h"
+#include "ui/base/base_window.h"
+#include "ui/gfx/insets.h"
+
+namespace apps {
+
+// This is an interface to a native implementation of a shell window, used for
+// new-style packaged apps. Shell windows contain a web contents, but no tabs
+// or URL bar.
+class NativeAppWindow : public ui::BaseWindow,
+ public web_modal::WebContentsModalDialogHost {
+ public:
+ // Called when the draggable regions are changed.
+ virtual void UpdateDraggableRegions(
+ const std::vector<extensions::DraggableRegion>& regions) = 0;
+
+ virtual void SetFullscreen(bool fullscreen) = 0;
+ virtual bool IsFullscreenOrPending() const = 0;
+
+ // Returns true if the window is a panel that has been detached.
+ virtual bool IsDetached() const = 0;
+
+ // Called when the icon of the window changes.
+ virtual void UpdateWindowIcon() = 0;
+
+ // Called when the title of the window changes.
+ virtual void UpdateWindowTitle() = 0;
+
+ // Allows the window to handle unhandled keyboard messages coming back from
+ // the renderer.
+ virtual void HandleKeyboardEvent(
+ const content::NativeWebKeyboardEvent& event) = 0;
+
+ // TODO(jianli): once http://crbug.com/123007 is fixed, we'll no longer need
+ // this.
+ virtual void RenderViewHostChanged() = 0;
+
+ // Returns the difference between the window bounds (including titlebar and
+ // borders) and the content bounds, if any.
+ virtual gfx::Insets GetFrameInsets() const = 0;
+
+ virtual ~NativeAppWindow() {}
+};
+
+} // namespace apps
+
+#endif // APPS_NATIVE_APP_WINDOW_H_
diff --git a/apps/shell_window.cc b/apps/shell_window.cc
index d0dd9cc0c0..12585aad5d 100644
--- a/apps/shell_window.cc
+++ b/apps/shell_window.cc
@@ -4,6 +4,7 @@
#include "apps/shell_window.h"
+#include "apps/native_app_window.h"
#include "apps/shell_window_geometry_cache.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -15,7 +16,6 @@
#include "chrome/browser/extensions/suggest_permission_util.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/extensions/native_app_window.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_messages.h"
@@ -156,7 +156,7 @@ void ShellWindow::Init(const GURL& url,
new_params.bounds = bounds;
- native_app_window_.reset(NativeAppWindow::Create(this, new_params));
+ native_app_window_.reset(delegate_->CreateNativeAppWindow(this, new_params));
if (!new_params.hidden) {
if (window_type_is_panel())
diff --git a/apps/shell_window.h b/apps/shell_window.h
index a10cb5bd55..6bf4ebfe53 100644
--- a/apps/shell_window.h
+++ b/apps/shell_window.h
@@ -21,7 +21,6 @@
class GURL;
class Profile;
-class NativeAppWindow;
class SkRegion;
namespace content {
@@ -42,6 +41,8 @@ class BaseWindow;
namespace apps {
+class NativeAppWindow;
+
// Manages the web contents for Shell Windows. The implementation for this
// class should create and maintain the WebContents for the window, and handle
// any message passing between the web contents and the extension system or
@@ -130,6 +131,9 @@ class ShellWindow : public content::NotificationObserver,
// General initialization.
virtual void InitWebContents(content::WebContents* web_contents) = 0;
+ virtual NativeAppWindow* CreateNativeAppWindow(
+ ShellWindow* window,
+ const CreateParams& params) = 0;
// Link handling.
virtual content::WebContents* OpenURLFromTab(