| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_GTK_EXTENSIONS_SHELL_WINDOW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_EXTENSIONS_SHELL_WINDOW_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_EXTENSIONS_SHELL_WINDOW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_EXTENSIONS_SHELL_WINDOW_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "base/timer.h" | 10 #include "base/timer.h" |
| 11 #include "chrome/browser/ui/extensions/native_shell_window.h" | 11 #include "chrome/browser/ui/extensions/native_shell_window.h" |
| 12 #include "chrome/browser/ui/extensions/shell_window.h" | 12 #include "chrome/browser/ui/extensions/shell_window.h" |
| 13 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" | 13 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" |
| 14 #include "third_party/skia/include/core/SkRegion.h" | |
| 15 #include "ui/base/gtk/gtk_signal.h" | 14 #include "ui/base/gtk/gtk_signal.h" |
| 16 #include "ui/base/x/active_window_watcher_x_observer.h" | 15 #include "ui/base/x/active_window_watcher_x_observer.h" |
| 17 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 18 | 17 |
| 19 class ExtensionKeybindingRegistryGtk; | 18 class ExtensionKeybindingRegistryGtk; |
| 20 class Profile; | 19 class Profile; |
| 21 | 20 |
| 22 namespace extensions { | 21 namespace extensions { |
| 23 class Extension; | 22 class Extension; |
| 24 struct DraggableRegion; | |
| 25 } | 23 } |
| 26 | 24 |
| 27 class ShellWindowGtk : public NativeShellWindow, | 25 class ShellWindowGtk : public NativeShellWindow, |
| 28 public ExtensionViewGtk::Container, | 26 public ExtensionViewGtk::Container, |
| 29 public ui::ActiveWindowWatcherXObserver { | 27 public ui::ActiveWindowWatcherXObserver { |
| 30 public: | 28 public: |
| 31 ShellWindowGtk(ShellWindow* shell_window, | 29 ShellWindowGtk(ShellWindow* shell_window, |
| 32 const ShellWindow::CreateParams& params); | 30 const ShellWindow::CreateParams& params); |
| 33 | 31 |
| 34 // BaseWindow implementation. | 32 // BaseWindow implementation. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 62 virtual void UpdateWindowTitle() OVERRIDE; | 60 virtual void UpdateWindowTitle() OVERRIDE; |
| 63 virtual void HandleKeyboardEvent( | 61 virtual void HandleKeyboardEvent( |
| 64 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 62 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
| 65 | 63 |
| 66 content::WebContents* web_contents() const { | 64 content::WebContents* web_contents() const { |
| 67 return shell_window_->web_contents(); | 65 return shell_window_->web_contents(); |
| 68 } | 66 } |
| 69 const extensions::Extension* extension() const { | 67 const extensions::Extension* extension() const { |
| 70 return shell_window_->extension(); | 68 return shell_window_->extension(); |
| 71 } | 69 } |
| 72 virtual void UpdateDraggableRegions( | |
| 73 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; | |
| 74 virtual void UpdateLegacyDraggableRegions( | |
| 75 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; | |
| 76 | 70 |
| 77 virtual ~ShellWindowGtk(); | 71 virtual ~ShellWindowGtk(); |
| 78 | 72 |
| 79 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnMainWindowDeleteEvent, | 73 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnMainWindowDeleteEvent, |
| 80 GdkEvent*); | 74 GdkEvent*); |
| 81 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnConfigure, | 75 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnConfigure, |
| 82 GdkEventConfigure*); | 76 GdkEventConfigure*); |
| 83 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnWindowState, | 77 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnWindowState, |
| 84 GdkEventWindowState*); | 78 GdkEventWindowState*); |
| 85 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnButtonPress, | 79 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnButtonPress, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 100 // The position and size of the current window. | 94 // The position and size of the current window. |
| 101 gfx::Rect bounds_; | 95 gfx::Rect bounds_; |
| 102 | 96 |
| 103 // The position and size of the non-maximized, non-fullscreen window. | 97 // The position and size of the non-maximized, non-fullscreen window. |
| 104 gfx::Rect restored_bounds_; | 98 gfx::Rect restored_bounds_; |
| 105 | 99 |
| 106 // True if the RVH is in fullscreen mode. The window may not actually be in | 100 // True if the RVH is in fullscreen mode. The window may not actually be in |
| 107 // fullscreen, however: some WMs don't support fullscreen. | 101 // fullscreen, however: some WMs don't support fullscreen. |
| 108 bool content_thinks_its_fullscreen_; | 102 bool content_thinks_its_fullscreen_; |
| 109 | 103 |
| 110 // The region is treated as title bar, can be dragged to move | |
| 111 // and double clicked to maximize. | |
| 112 SkRegion draggable_region_; | |
| 113 | |
| 114 // If true, don't call gdk_window_raise() when we get a click in the title | 104 // If true, don't call gdk_window_raise() when we get a click in the title |
| 115 // bar or window border. This is to work around a compiz bug. | 105 // bar or window border. This is to work around a compiz bug. |
| 116 bool suppress_window_raise_; | 106 bool suppress_window_raise_; |
| 117 | 107 |
| 118 // True if the window shows without frame. | 108 // True if the window shows without frame. |
| 119 bool frameless_; | 109 bool frameless_; |
| 120 | 110 |
| 121 // The timer used to save the window position for session restore. | 111 // The timer used to save the window position for session restore. |
| 122 base::OneShotTimer<ShellWindowGtk> window_configure_debounce_timer_; | 112 base::OneShotTimer<ShellWindowGtk> window_configure_debounce_timer_; |
| 123 | 113 |
| 124 // The Extension Keybinding Registry responsible for registering listeners for | 114 // The Extension Keybinding Registry responsible for registering listeners for |
| 125 // accelerators that are sent to the window, that are destined to be turned | 115 // accelerators that are sent to the window, that are destined to be turned |
| 126 // into events and sent to the extension. | 116 // into events and sent to the extension. |
| 127 scoped_ptr<ExtensionKeybindingRegistryGtk> extension_keybinding_registry_; | 117 scoped_ptr<ExtensionKeybindingRegistryGtk> extension_keybinding_registry_; |
| 128 | 118 |
| 129 DISALLOW_COPY_AND_ASSIGN(ShellWindowGtk); | 119 DISALLOW_COPY_AND_ASSIGN(ShellWindowGtk); |
| 130 }; | 120 }; |
| 131 | 121 |
| 132 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_SHELL_WINDOW_GTK_H_ | 122 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_SHELL_WINDOW_GTK_H_ |
| OLD | NEW |