diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-16 03:09:11 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-16 03:09:11 +0000 |
commit | aad2787091c3ec293d97926a07874af4c8c5b33d (patch) | |
tree | caa58293e74a2c371d4c2d5ba37fb061c44cb0cc | |
parent | 15f8d132a8e59ea709c1ff5df3aa068c5ff83ced (diff) | |
download | chromium_src-aad2787091c3ec293d97926a07874af4c8c5b33d.zip chromium_src-aad2787091c3ec293d97926a07874af4c8c5b33d.tar.gz chromium_src-aad2787091c3ec293d97926a07874af4c8c5b33d.tar.bz2 |
Fix declaration vs. implementation ordering in NativeAppWindow{Views|Gtk}
This just reorders the functions in the NativeAppWindow interface. There are
other ordering problems but they aren't worth fixing.
Also move native_app_window.h into apps/ui/.
BUG=306535
TEST=compiles
TBR=benwells@chromium.org for file moves and trivial header path renames
Review URL: https://codereview.chromium.org/27207003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228848 0039d316-1c4b-4281-b951-d872f2087c98
30 files changed, 130 insertions, 129 deletions
diff --git a/apps/app_shim/extension_app_shim_handler_mac.cc b/apps/app_shim/extension_app_shim_handler_mac.cc index 9cd2070e..3c08f2d 100644 --- a/apps/app_shim/extension_app_shim_handler_mac.cc +++ b/apps/app_shim/extension_app_shim_handler_mac.cc @@ -8,9 +8,9 @@ #include "apps/app_shim/app_shim_host_manager_mac.h" #include "apps/app_shim/app_shim_messages.h" #include "apps/launcher.h" -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/files/file_path.h" #include "base/logging.h" #include "chrome/browser/browser_process.h" diff --git a/apps/app_window_contents.cc b/apps/app_window_contents.cc index ccafd05..4f11a10 100644 --- a/apps/app_window_contents.cc +++ b/apps/app_window_contents.cc @@ -4,7 +4,7 @@ #include "apps/app_window_contents.h" -#include "apps/native_app_window.h" +#include "apps/ui/native_app_window.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/api/app_window.h" diff --git a/apps/apps.gypi b/apps/apps.gypi index 62f6d896..2b8589a 100644 --- a/apps/apps.gypi +++ b/apps/apps.gypi @@ -53,7 +53,6 @@ 'launcher.cc', 'launcher.h', 'metrics_names.h', - 'native_app_window.h', 'pref_names.cc', 'pref_names.h', 'prefs.cc', @@ -70,6 +69,7 @@ 'shell_window_registry.h', 'switches.cc', 'switches.h', + 'ui/native_app_window.h', 'ui/views/shell_window_frame_view.cc', 'ui/views/shell_window_frame_view.h', ], diff --git a/apps/shell_window.cc b/apps/shell_window.cc index e722f4a..6c20a87 100644 --- a/apps/shell_window.cc +++ b/apps/shell_window.cc @@ -4,9 +4,9 @@ #include "apps/shell_window.h" -#include "apps/native_app_window.h" #include "apps/shell_window_geometry_cache.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" diff --git a/apps/shell_window_registry.cc b/apps/shell_window_registry.cc index 677a8c6..c44b924 100644 --- a/apps/shell_window_registry.cc +++ b/apps/shell_window_registry.cc @@ -3,9 +3,9 @@ // found in the LICENSE file. #include "apps/apps_client.h" -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/common/extensions/extension.h" #include "components/browser_context_keyed_service/browser_context_dependency_manager.h" diff --git a/apps/native_app_window.h b/apps/ui/native_app_window.h index 8344914..c20e3b1 100644 --- a/apps/native_app_window.h +++ b/apps/ui/native_app_window.h @@ -2,8 +2,8 @@ // 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_ +#ifndef APPS_UI_NATIVE_APP_WINDOW_H_ +#define APPS_UI_NATIVE_APP_WINDOW_H_ #include "apps/shell_window.h" #include "components/web_modal/web_contents_modal_dialog_host.h" @@ -18,17 +18,7 @@ namespace apps { 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; - - // Returns the region used by frameless windows for dragging. May return NULL. - virtual SkRegion* GetDraggableRegion() = 0; - - // Called when the region that accepts input events is changed. - // If |region| is NULL, then the entire window will accept input events. - virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) = 0; - + // Fullscreen changes may be asynchronous on some platforms. virtual void SetFullscreen(bool fullscreen) = 0; virtual bool IsFullscreenOrPending() const = 0; @@ -41,6 +31,17 @@ class NativeAppWindow : public ui::BaseWindow, // Called when the title of the window changes. virtual void UpdateWindowTitle() = 0; + // Called when the draggable regions are changed. + virtual void UpdateDraggableRegions( + const std::vector<extensions::DraggableRegion>& regions) = 0; + + // Returns the region used by frameless windows for dragging. May return NULL. + virtual SkRegion* GetDraggableRegion() = 0; + + // Called when the region that accepts input events is changed. + // If |region| is NULL, then the entire window will accept input events. + virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) = 0; + // Allows the window to handle unhandled keyboard messages coming back from // the renderer. virtual void HandleKeyboardEvent( @@ -68,4 +69,4 @@ class NativeAppWindow : public ui::BaseWindow, } // namespace apps -#endif // APPS_NATIVE_APP_WINDOW_H_ +#endif // APPS_UI_NATIVE_APP_WINDOW_H_ diff --git a/apps/ui/views/shell_window_frame_view.cc b/apps/ui/views/shell_window_frame_view.cc index 971cb48..fc8e540 100644 --- a/apps/ui/views/shell_window_frame_view.cc +++ b/apps/ui/views/shell_window_frame_view.cc @@ -4,7 +4,7 @@ #include "apps/ui/views/shell_window_frame_view.h" -#include "apps/native_app_window.h" +#include "apps/ui/native_app_window.h" #include "base/strings/utf_string_conversions.h" #include "extensions/common/draggable_region.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc index 792695a..e93de75 100644 --- a/chrome/browser/apps/app_browsertest.cc +++ b/chrome/browser/apps/app_browsertest.cc @@ -3,9 +3,9 @@ // found in the LICENSE file. #include "apps/launcher.h" -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/bind.h" #include "base/command_line.h" #include "base/file_util.h" diff --git a/chrome/browser/apps/app_browsertest_util.cc b/chrome/browser/apps/app_browsertest_util.cc index 7eb201d..6b75b5c 100644 --- a/chrome/browser/apps/app_browsertest_util.cc +++ b/chrome/browser/apps/app_browsertest_util.cc @@ -5,8 +5,8 @@ #include "chrome/browser/apps/app_browsertest_util.h" #include "apps/app_window_contents.h" -#include "apps/native_app_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/command_line.h" #include "base/strings/stringprintf.h" #include "chrome/browser/extensions/api/tabs/tabs_api.h" diff --git a/chrome/browser/apps/web_view_browsertest.cc b/chrome/browser/apps/web_view_browsertest.cc index 38d35b1..ae0db65 100644 --- a/chrome/browser/apps/web_view_browsertest.cc +++ b/chrome/browser/apps/web_view_browsertest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/native_app_window.h" +#include "apps/ui/native_app_window.h" #include "base/path_service.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/chromeos/login/kiosk_browsertest.cc b/chrome/browser/chromeos/login/kiosk_browsertest.cc index 9e2f1b9..5e3e9e1 100644 --- a/chrome/browser/chromeos/login/kiosk_browsertest.cc +++ b/chrome/browser/chromeos/login/kiosk_browsertest.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" diff --git a/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc b/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc index 142d0d1..8dbd8b6 100644 --- a/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc +++ b/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc @@ -4,9 +4,9 @@ #include "chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.h" -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/command_line.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/api/app_current_window_internal.h" diff --git a/chrome/browser/extensions/api/app_window/app_window_api.cc b/chrome/browser/extensions/api/app_window/app_window_api.cc index 34ab489..d4cf282 100644 --- a/chrome/browser/extensions/api/app_window/app_window_api.cc +++ b/chrome/browser/extensions/api/app_window/app_window_api.cc @@ -5,9 +5,9 @@ #include "chrome/browser/extensions/api/app_window/app_window_api.h" #include "apps/app_window_contents.h" -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/command_line.h" #include "base/time/time.h" #include "base/values.h" diff --git a/chrome/browser/extensions/api/app_window/app_window_apitest.cc b/chrome/browser/extensions/api/app_window/app_window_apitest.cc index f71f0c7..7701a5c 100644 --- a/chrome/browser/extensions/api/app_window/app_window_apitest.cc +++ b/chrome/browser/extensions/api/app_window/app_window_apitest.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" #include "chrome/browser/apps/app_browsertest_util.h" diff --git a/chrome/browser/extensions/api/tabs/ash_panel_contents.cc b/chrome/browser/extensions/api/tabs/ash_panel_contents.cc index 5ebf696..72718e2 100644 --- a/chrome/browser/extensions/api/tabs/ash_panel_contents.cc +++ b/chrome/browser/extensions/api/tabs/ash_panel_contents.cc @@ -4,7 +4,7 @@ #include "chrome/browser/extensions/api/tabs/ash_panel_contents.h" -#include "apps/native_app_window.h" +#include "apps/ui/native_app_window.h" #include "base/values.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/api/tabs/tabs_constants.h" diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index df71d58..3346214 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc @@ -141,9 +141,9 @@ #endif #if !defined(OS_MACOSX) -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/basictypes.h" #include "base/compiler_specific.h" #include "chrome/browser/ui/extensions/application_launch.h" diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc index e01ec08..f0543bc 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc @@ -4,9 +4,9 @@ #include "chrome/browser/ui/ash/chrome_shell_delegate.h" -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "ash/host/root_window_host_factory.h" #include "ash/magnifier/magnifier_constants.h" #include "ash/session_state_delegate.h" diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc b/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc index b06b048..8920217 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc @@ -4,8 +4,8 @@ #include "chrome/browser/ui/ash/chrome_shell_delegate.h" -#include "apps/native_app_window.h" #include "apps/shell_window.h" +#include "apps/ui/native_app_window.h" #include "ash/ash_switches.h" #include "ash/shell.h" #include "ash/shell_delegate.h" diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc index 0e80926..0c37d2a 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc @@ -4,8 +4,8 @@ #include "chrome/browser/ui/ash/chrome_shell_delegate.h" -#include "apps/native_app_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "ash/keyboard_overlay/keyboard_overlay_view.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/window_util.h" diff --git a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc index a05ff2e..e6dcb12 100644 --- a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc @@ -4,7 +4,7 @@ #include "chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h" -#include "apps/native_app_window.h" +#include "apps/ui/native_app_window.h" #include "ash/launcher/launcher_model.h" #include "ash/shell.h" #include "ash/wm/window_util.h" diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc index baab616..99d30de 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc @@ -4,9 +4,9 @@ #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "ash/ash_switches.h" #include "ash/display/display_controller.h" #include "ash/launcher/launcher.h" diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc index c383007..da7cd33 100644 --- a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc @@ -4,8 +4,8 @@ #include "chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h" -#include "apps/native_app_window.h" #include "apps/shell_window.h" +#include "apps/ui/native_app_window.h" #include "ash/launcher/launcher_model.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc index a6cacdf..ff9d063 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc @@ -8,9 +8,9 @@ #include <map> #include <string> -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/base64.h" #include "base/bind.h" #include "base/i18n/case_conversion.h" diff --git a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm index 09ca5fa..b7eb559 100644 --- a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm +++ b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm @@ -6,8 +6,8 @@ #import <Cocoa/Cocoa.h> -#include "apps/native_app_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/command_line.h" #include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h index 676a381..b616cb5 100644 --- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h +++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h @@ -8,8 +8,8 @@ #import <Cocoa/Cocoa.h> #include <vector> -#include "apps/native_app_window.h" #include "apps/shell_window.h" +#include "apps/ui/native_app_window.h" #include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/browser_command_executor.h" diff --git a/chrome/browser/ui/gtk/apps/native_app_window_gtk.cc b/chrome/browser/ui/gtk/apps/native_app_window_gtk.cc index 929fafd..c9b429d 100644 --- a/chrome/browser/ui/gtk/apps/native_app_window_gtk.cc +++ b/chrome/browser/ui/gtk/apps/native_app_window_gtk.cc @@ -352,39 +352,6 @@ void NativeAppWindowGtk::RenderViewHostChanged( web_contents()->GetView()->Focus(); } -gfx::Insets NativeAppWindowGtk::GetFrameInsets() const { - if (frameless_) - return gfx::Insets(); - GdkWindow* gdk_window = gtk_widget_get_window(GTK_WIDGET(window_)); - if (!gdk_window) - return gfx::Insets(); - - gint current_width = 0; - gint current_height = 0; - gtk_window_get_size(window_, ¤t_width, ¤t_height); - gint current_x = 0; - gint current_y = 0; - gdk_window_get_position(gdk_window, ¤t_x, ¤t_y); - GdkRectangle rect_with_decorations = {0}; - gdk_window_get_frame_extents(gdk_window, - &rect_with_decorations); - - int left_inset = current_x - rect_with_decorations.x; - int top_inset = current_y - rect_with_decorations.y; - return gfx::Insets( - top_inset, - left_inset, - rect_with_decorations.height - current_height - top_inset, - rect_with_decorations.width - current_width - left_inset); -} - -bool NativeAppWindowGtk::IsVisible() const { - return gtk_widget_get_visible(GTK_WIDGET(window_)); -} - -void NativeAppWindowGtk::HideWithApp() {} -void NativeAppWindowGtk::ShowWithApp() {} - void NativeAppWindowGtk::SetAlwaysOnTop(bool always_on_top) { if (always_on_top_ != always_on_top) { // gdk_window_get_state() does not give us the correct value for the @@ -650,15 +617,6 @@ void NativeAppWindowGtk::UpdateWindowTitle() { gtk_window_set_title(window_, UTF16ToUTF8(title).c_str()); } -void NativeAppWindowGtk::HandleKeyboardEvent( - const content::NativeWebKeyboardEvent& event) { - // No-op. -} - -void NativeAppWindowGtk::UpdateInputRegion(scoped_ptr<SkRegion> region) { - NOTIMPLEMENTED(); -} - void NativeAppWindowGtk::UpdateDraggableRegions( const std::vector<extensions::DraggableRegion>& regions) { // Draggable region is not supported for non-frameless window. @@ -672,6 +630,48 @@ SkRegion* NativeAppWindowGtk::GetDraggableRegion() { return draggable_region_.get(); } +void NativeAppWindowGtk::UpdateInputRegion(scoped_ptr<SkRegion> region) { + NOTIMPLEMENTED(); +} + +void NativeAppWindowGtk::HandleKeyboardEvent( + const content::NativeWebKeyboardEvent& event) { + // No-op. +} + bool NativeAppWindowGtk::IsFrameless() const { return frameless_; } + +gfx::Insets NativeAppWindowGtk::GetFrameInsets() const { + if (frameless_) + return gfx::Insets(); + GdkWindow* gdk_window = gtk_widget_get_window(GTK_WIDGET(window_)); + if (!gdk_window) + return gfx::Insets(); + + gint current_width = 0; + gint current_height = 0; + gtk_window_get_size(window_, ¤t_width, ¤t_height); + gint current_x = 0; + gint current_y = 0; + gdk_window_get_position(gdk_window, ¤t_x, ¤t_y); + GdkRectangle rect_with_decorations = {0}; + gdk_window_get_frame_extents(gdk_window, + &rect_with_decorations); + + int left_inset = current_x - rect_with_decorations.x; + int top_inset = current_y - rect_with_decorations.y; + return gfx::Insets( + top_inset, + left_inset, + rect_with_decorations.height - current_height - top_inset, + rect_with_decorations.width - current_width - left_inset); +} + +bool NativeAppWindowGtk::IsVisible() const { + return gtk_widget_get_visible(GTK_WIDGET(window_)); +} + +void NativeAppWindowGtk::HideWithApp() {} +void NativeAppWindowGtk::ShowWithApp() {} diff --git a/chrome/browser/ui/gtk/apps/native_app_window_gtk.h b/chrome/browser/ui/gtk/apps/native_app_window_gtk.h index 1e55de5..462256e 100644 --- a/chrome/browser/ui/gtk/apps/native_app_window_gtk.h +++ b/chrome/browser/ui/gtk/apps/native_app_window_gtk.h @@ -7,8 +7,8 @@ #include <gtk/gtk.h> -#include "apps/native_app_window.h" #include "apps/shell_window.h" +#include "apps/ui/native_app_window.h" #include "base/observer_list.h" #include "base/timer/timer.h" #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" @@ -39,7 +39,6 @@ class NativeAppWindowGtk : public apps::NativeAppWindow, virtual bool IsMaximized() const OVERRIDE; virtual bool IsMinimized() const OVERRIDE; virtual bool IsFullscreen() const OVERRIDE; - virtual bool IsDetached() const OVERRIDE; virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; virtual gfx::Rect GetRestoredBounds() const OVERRIDE; virtual ui::WindowShowState GetRestoredState() const OVERRIDE; @@ -56,6 +55,7 @@ class NativeAppWindowGtk : public apps::NativeAppWindow, virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; virtual void FlashFrame(bool flash) OVERRIDE; virtual bool IsAlwaysOnTop() const OVERRIDE; + virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; // ActiveWindowWatcherXObserver implementation. virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; @@ -69,20 +69,20 @@ class NativeAppWindowGtk : public apps::NativeAppWindow, // NativeAppWindow implementation. virtual void SetFullscreen(bool fullscreen) OVERRIDE; virtual bool IsFullscreenOrPending() const OVERRIDE; + virtual bool IsDetached() const OVERRIDE; virtual void UpdateWindowIcon() OVERRIDE; virtual void UpdateWindowTitle() OVERRIDE; - virtual void HandleKeyboardEvent( - const content::NativeWebKeyboardEvent& event) OVERRIDE; - virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) OVERRIDE; virtual void UpdateDraggableRegions( const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; virtual SkRegion* GetDraggableRegion() OVERRIDE; + virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) OVERRIDE; + virtual void HandleKeyboardEvent( + const content::NativeWebKeyboardEvent& event) OVERRIDE; virtual bool IsFrameless() const OVERRIDE; virtual gfx::Insets GetFrameInsets() const OVERRIDE; virtual bool IsVisible() const OVERRIDE; virtual void HideWithApp() OVERRIDE; virtual void ShowWithApp() OVERRIDE; - virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; // web_modal::WebContentsModalDialogHost implementation. virtual gfx::NativeView GetHostView() const OVERRIDE; diff --git a/chrome/browser/ui/views/apps/native_app_window_views.cc b/chrome/browser/ui/views/apps/native_app_window_views.cc index a0eb674..c39d042 100644 --- a/chrome/browser/ui/views/apps/native_app_window_views.cc +++ b/chrome/browser/ui/views/apps/native_app_window_views.cc @@ -455,33 +455,6 @@ bool NativeAppWindowViews::IsAlwaysOnTop() const { } } -bool NativeAppWindowViews::IsFrameless() const { - return frameless_; -} - -gfx::Insets NativeAppWindowViews::GetFrameInsets() const { - if (frameless_) - return gfx::Insets(); - - // The pretend client_bounds passed in need to be large enough to ensure that - // GetWindowBoundsForClientBounds() doesn't decide that it needs more than - // the specified amount of space to fit the window controls in, and return a - // number larger than the real frame insets. Most window controls are smaller - // than 1000x1000px, so this should be big enough. - gfx::Rect client_bounds = gfx::Rect(1000, 1000); - gfx::Rect window_bounds = - window_->non_client_view()->GetWindowBoundsForClientBounds( - client_bounds); - return window_bounds.InsetsFrom(client_bounds); -} - -bool NativeAppWindowViews::IsVisible() const { - return window_->IsVisible(); -} - -void NativeAppWindowViews::HideWithApp() {} -void NativeAppWindowViews::ShowWithApp() {} - void NativeAppWindowViews::SetAlwaysOnTop(bool always_on_top) { window_->SetAlwaysOnTop(always_on_top); shell_window_->OnNativeWindowChanged(); @@ -642,6 +615,10 @@ const views::Widget* NativeAppWindowViews::GetWidget() const { return window_; } +views::View* NativeAppWindowViews::GetContentsView() { + return this; +} + views::NonClientFrameView* NativeAppWindowViews::CreateNonClientFrameView( views::Widget* widget) { #if defined(USE_ASH) @@ -717,6 +694,12 @@ void NativeAppWindowViews::RenderViewCreated( } } +void NativeAppWindowViews::RenderViewHostChanged( + content::RenderViewHost* old_host, + content::RenderViewHost* new_host) { + OnViewWasResized(); +} + // views::View implementation. void NativeAppWindowViews::Layout() { @@ -797,10 +780,6 @@ bool NativeAppWindowViews::IsDetached() const { #endif } -views::View* NativeAppWindowViews::GetContentsView() { - return this; -} - void NativeAppWindowViews::UpdateWindowIcon() { window_->UpdateWindowIcon(); } @@ -809,10 +788,6 @@ void NativeAppWindowViews::UpdateWindowTitle() { window_->UpdateWindowTitle(); } -void NativeAppWindowViews::UpdateInputRegion(scoped_ptr<SkRegion> region) { - input_region_ = region.Pass(); -} - void NativeAppWindowViews::UpdateDraggableRegions( const std::vector<extensions::DraggableRegion>& regions) { // Draggable region is not supported for non-frameless window. @@ -827,14 +802,39 @@ SkRegion* NativeAppWindowViews::GetDraggableRegion() { return draggable_region_.get(); } +void NativeAppWindowViews::UpdateInputRegion(scoped_ptr<SkRegion> region) { + input_region_ = region.Pass(); +} + void NativeAppWindowViews::HandleKeyboardEvent( const content::NativeWebKeyboardEvent& event) { unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, GetFocusManager()); } -void NativeAppWindowViews::RenderViewHostChanged( - content::RenderViewHost* old_host, - content::RenderViewHost* new_host) { - OnViewWasResized(); +bool NativeAppWindowViews::IsFrameless() const { + return frameless_; } + +gfx::Insets NativeAppWindowViews::GetFrameInsets() const { + if (frameless_) + return gfx::Insets(); + + // The pretend client_bounds passed in need to be large enough to ensure that + // GetWindowBoundsForClientBounds() doesn't decide that it needs more than + // the specified amount of space to fit the window controls in, and return a + // number larger than the real frame insets. Most window controls are smaller + // than 1000x1000px, so this should be big enough. + gfx::Rect client_bounds = gfx::Rect(1000, 1000); + gfx::Rect window_bounds = + window_->non_client_view()->GetWindowBoundsForClientBounds( + client_bounds); + return window_bounds.InsetsFrom(client_bounds); +} + +bool NativeAppWindowViews::IsVisible() const { + return window_->IsVisible(); +} + +void NativeAppWindowViews::HideWithApp() {} +void NativeAppWindowViews::ShowWithApp() {} diff --git a/chrome/browser/ui/views/apps/native_app_window_views.h b/chrome/browser/ui/views/apps/native_app_window_views.h index e238bd8..caecca3 100644 --- a/chrome/browser/ui/views/apps/native_app_window_views.h +++ b/chrome/browser/ui/views/apps/native_app_window_views.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ #define CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ -#include "apps/native_app_window.h" #include "apps/shell_window.h" +#include "apps/ui/native_app_window.h" #include "base/observer_list.h" #include "content/public/browser/web_contents_observer.h" #include "third_party/skia/include/core/SkRegion.h" @@ -88,6 +88,7 @@ class NativeAppWindowViews : public apps::NativeAppWindow, virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; virtual void FlashFrame(bool flash) OVERRIDE; virtual bool IsAlwaysOnTop() const OVERRIDE; + virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; // WidgetDelegate implementation. virtual void OnWidgetMove() OVERRIDE; @@ -142,10 +143,10 @@ class NativeAppWindowViews : public apps::NativeAppWindow, virtual bool IsDetached() const OVERRIDE; virtual void UpdateWindowIcon() OVERRIDE; virtual void UpdateWindowTitle() OVERRIDE; - virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) OVERRIDE; virtual void UpdateDraggableRegions( const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; virtual SkRegion* GetDraggableRegion() OVERRIDE; + virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) OVERRIDE; virtual void HandleKeyboardEvent( const content::NativeWebKeyboardEvent& event) OVERRIDE; virtual bool IsFrameless() const OVERRIDE; @@ -153,7 +154,6 @@ class NativeAppWindowViews : public apps::NativeAppWindow, virtual bool IsVisible() const OVERRIDE; virtual void HideWithApp() OVERRIDE; virtual void ShowWithApp() OVERRIDE; - virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; // web_modal::WebContentsModalDialogHost implementation. virtual gfx::NativeView GetHostView() const OVERRIDE; diff --git a/chrome/browser/ui/views/select_file_dialog_extension.cc b/chrome/browser/ui/views/select_file_dialog_extension.cc index 9507d84..214b12d 100644 --- a/chrome/browser/ui/views/select_file_dialog_extension.cc +++ b/chrome/browser/ui/views/select_file_dialog_extension.cc @@ -4,9 +4,9 @@ #include "chrome/browser/ui/views/select_file_dialog_extension.h" -#include "apps/native_app_window.h" #include "apps/shell_window.h" #include "apps/shell_window_registry.h" +#include "apps/ui/native_app_window.h" #include "base/bind.h" #include "base/callback.h" #include "base/logging.h" |