OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_APPS_NATIVE_APP_WINDOW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_APPS_NATIVE_APP_WINDOW_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_APPS_NATIVE_APP_WINDOW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_APPS_NATIVE_APP_WINDOW_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "apps/native_app_window.h" | 10 #include "apps/native_app_window.h" |
11 #include "apps/shell_window.h" | 11 #include "apps/shell_window.h" |
12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
14 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" | 14 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" |
| 15 #include "content/public/browser/web_contents_observer.h" |
15 #include "third_party/skia/include/core/SkRegion.h" | 16 #include "third_party/skia/include/core/SkRegion.h" |
16 #include "ui/base/gtk/gtk_signal.h" | 17 #include "ui/base/gtk/gtk_signal.h" |
17 #include "ui/base/x/active_window_watcher_x_observer.h" | 18 #include "ui/base/x/active_window_watcher_x_observer.h" |
18 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
19 #include "ui/gfx/x/x11_atom_cache.h" | 20 #include "ui/gfx/x/x11_atom_cache.h" |
20 | 21 |
21 class ExtensionKeybindingRegistryGtk; | 22 class ExtensionKeybindingRegistryGtk; |
22 class Profile; | 23 class Profile; |
23 | 24 |
24 namespace extensions { | 25 namespace extensions { |
25 class Extension; | 26 class Extension; |
26 } | 27 } |
27 | 28 |
28 class NativeAppWindowGtk : public apps::NativeAppWindow, | 29 class NativeAppWindowGtk : public apps::NativeAppWindow, |
29 public ExtensionViewGtk::Container, | 30 public ExtensionViewGtk::Container, |
30 public ui::ActiveWindowWatcherXObserver { | 31 public ui::ActiveWindowWatcherXObserver, |
| 32 public content::WebContentsObserver { |
31 public: | 33 public: |
32 NativeAppWindowGtk(apps::ShellWindow* shell_window, | 34 NativeAppWindowGtk(apps::ShellWindow* shell_window, |
33 const apps::ShellWindow::CreateParams& params); | 35 const apps::ShellWindow::CreateParams& params); |
34 | 36 |
35 // ui::BaseWindow implementation. | 37 // ui::BaseWindow implementation. |
36 virtual bool IsActive() const OVERRIDE; | 38 virtual bool IsActive() const OVERRIDE; |
37 virtual bool IsMaximized() const OVERRIDE; | 39 virtual bool IsMaximized() const OVERRIDE; |
38 virtual bool IsMinimized() const OVERRIDE; | 40 virtual bool IsMinimized() const OVERRIDE; |
39 virtual bool IsFullscreen() const OVERRIDE; | 41 virtual bool IsFullscreen() const OVERRIDE; |
40 virtual bool IsDetached() const OVERRIDE; | 42 virtual bool IsDetached() const OVERRIDE; |
(...skipping 10 matching lines...) Expand all Loading... |
51 virtual void Maximize() OVERRIDE; | 53 virtual void Maximize() OVERRIDE; |
52 virtual void Minimize() OVERRIDE; | 54 virtual void Minimize() OVERRIDE; |
53 virtual void Restore() OVERRIDE; | 55 virtual void Restore() OVERRIDE; |
54 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 56 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
55 virtual void FlashFrame(bool flash) OVERRIDE; | 57 virtual void FlashFrame(bool flash) OVERRIDE; |
56 virtual bool IsAlwaysOnTop() const OVERRIDE; | 58 virtual bool IsAlwaysOnTop() const OVERRIDE; |
57 | 59 |
58 // ActiveWindowWatcherXObserver implementation. | 60 // ActiveWindowWatcherXObserver implementation. |
59 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; | 61 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; |
60 | 62 |
| 63 // WebContentsObserver implementation. |
| 64 virtual void RenderViewHostChanged( |
| 65 content::RenderViewHost* old_host, |
| 66 content::RenderViewHost* new_host) OVERRIDE; |
| 67 |
61 private: | 68 private: |
62 // NativeAppWindow implementation. | 69 // NativeAppWindow implementation. |
63 virtual void SetFullscreen(bool fullscreen) OVERRIDE; | 70 virtual void SetFullscreen(bool fullscreen) OVERRIDE; |
64 virtual bool IsFullscreenOrPending() const OVERRIDE; | 71 virtual bool IsFullscreenOrPending() const OVERRIDE; |
65 virtual void UpdateWindowIcon() OVERRIDE; | 72 virtual void UpdateWindowIcon() OVERRIDE; |
66 virtual void UpdateWindowTitle() OVERRIDE; | 73 virtual void UpdateWindowTitle() OVERRIDE; |
67 virtual void HandleKeyboardEvent( | 74 virtual void HandleKeyboardEvent( |
68 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 75 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
69 virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) OVERRIDE; | 76 virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) OVERRIDE; |
70 virtual void UpdateDraggableRegions( | 77 virtual void UpdateDraggableRegions( |
71 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; | 78 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; |
72 virtual void RenderViewHostChanged() OVERRIDE; | |
73 virtual gfx::Insets GetFrameInsets() const OVERRIDE; | 79 virtual gfx::Insets GetFrameInsets() const OVERRIDE; |
74 virtual void HideWithApp() OVERRIDE; | 80 virtual void HideWithApp() OVERRIDE; |
75 virtual void ShowWithApp() OVERRIDE; | 81 virtual void ShowWithApp() OVERRIDE; |
76 | 82 |
77 // web_modal::WebContentsModalDialogHost implementation. | 83 // web_modal::WebContentsModalDialogHost implementation. |
78 virtual gfx::NativeView GetHostView() const OVERRIDE; | 84 virtual gfx::NativeView GetHostView() const OVERRIDE; |
79 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; | 85 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; |
80 virtual gfx::Size GetMaximumDialogSize() OVERRIDE; | 86 virtual gfx::Size GetMaximumDialogSize() OVERRIDE; |
81 virtual void AddObserver( | 87 virtual void AddObserver( |
82 web_modal::WebContentsModalDialogHostObserver* observer) OVERRIDE; | 88 web_modal::WebContentsModalDialogHostObserver* observer) OVERRIDE; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 171 |
166 ui::X11AtomCache atom_cache_; | 172 ui::X11AtomCache atom_cache_; |
167 | 173 |
168 // True if we listen for the XEvent. | 174 // True if we listen for the XEvent. |
169 bool is_x_event_listened_; | 175 bool is_x_event_listened_; |
170 | 176 |
171 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowGtk); | 177 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowGtk); |
172 }; | 178 }; |
173 | 179 |
174 #endif // CHROME_BROWSER_UI_GTK_APPS_NATIVE_APP_WINDOW_GTK_H_ | 180 #endif // CHROME_BROWSER_UI_GTK_APPS_NATIVE_APP_WINDOW_GTK_H_ |
OLD | NEW |