diff options
author | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-06 01:18:19 +0000 |
---|---|---|
committer | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-06 01:18:19 +0000 |
commit | 1cd427c1a462ceebc270583c8c5dbd51dca25a73 (patch) | |
tree | febb2e2ebeee8815a215fc3df93c02bb53131f78 /apps | |
parent | 07035c71ee5198c26d775e975bdb91f5819287f9 (diff) | |
download | chromium_src-1cd427c1a462ceebc270583c8c5dbd51dca25a73.zip chromium_src-1cd427c1a462ceebc270583c8c5dbd51dca25a73.tar.gz chromium_src-1cd427c1a462ceebc270583c8c5dbd51dca25a73.tar.bz2 |
Move native_app_window code to apps areas
native_app_window.h -> apps component
platform specific implementations of this are now in c/b/ui/xxx/apps.
The platform specific implementations should also move to apps/ but
they would currently bring some unwanted dependencies with them; that
can happen later.
BUG=159366
Review URL: https://chromiumcodereview.appspot.com/21344002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps')
-rw-r--r-- | apps/DEPS | 1 | ||||
-rw-r--r-- | apps/app_shim/extension_app_shim_handler_mac.cc | 2 | ||||
-rw-r--r-- | apps/app_window_contents.cc | 2 | ||||
-rw-r--r-- | apps/apps.gypi | 1 | ||||
-rw-r--r-- | apps/native_app_window.h | 55 | ||||
-rw-r--r-- | apps/shell_window.cc | 4 | ||||
-rw-r--r-- | apps/shell_window.h | 6 |
7 files changed, 65 insertions, 6 deletions
@@ -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 cc09641..bf68bca 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" diff --git a/apps/app_window_contents.cc b/apps/app_window_contents.cc index bcefa3e..d163c2c 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 5b217b6..2a1bc99 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 0000000..0286453 --- /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 4f8bd42..15e7afd 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 a1e667b..c87a7e8 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( |