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_NATIVE_APP_WINDOW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_EXTENSIONS_NATIVE_APP_WINDOW_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_EXTENSIONS_NATIVE_APP_WINDOW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_EXTENSIONS_NATIVE_APP_WINDOW_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
| 10 #include "base/observer_list.h" |
10 #include "base/timer.h" | 11 #include "base/timer.h" |
11 #include "chrome/browser/ui/extensions/native_app_window.h" | 12 #include "chrome/browser/ui/extensions/native_app_window.h" |
12 #include "chrome/browser/ui/extensions/shell_window.h" | 13 #include "chrome/browser/ui/extensions/shell_window.h" |
13 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" | 14 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" |
14 #include "third_party/skia/include/core/SkRegion.h" | 15 #include "third_party/skia/include/core/SkRegion.h" |
15 #include "ui/base/gtk/gtk_signal.h" | 16 #include "ui/base/gtk/gtk_signal.h" |
16 #include "ui/base/x/active_window_watcher_x_observer.h" | 17 #include "ui/base/x/active_window_watcher_x_observer.h" |
17 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
18 | 19 |
19 class ExtensionKeybindingRegistryGtk; | 20 class ExtensionKeybindingRegistryGtk; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 virtual bool IsFullscreenOrPending() const OVERRIDE; | 61 virtual bool IsFullscreenOrPending() const OVERRIDE; |
61 virtual void UpdateWindowIcon() OVERRIDE; | 62 virtual void UpdateWindowIcon() OVERRIDE; |
62 virtual void UpdateWindowTitle() OVERRIDE; | 63 virtual void UpdateWindowTitle() OVERRIDE; |
63 virtual void HandleKeyboardEvent( | 64 virtual void HandleKeyboardEvent( |
64 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 65 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
65 virtual void UpdateDraggableRegions( | 66 virtual void UpdateDraggableRegions( |
66 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; | 67 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; |
67 virtual void RenderViewHostChanged() OVERRIDE; | 68 virtual void RenderViewHostChanged() OVERRIDE; |
68 virtual gfx::Insets GetFrameInsets() const OVERRIDE; | 69 virtual gfx::Insets GetFrameInsets() const OVERRIDE; |
69 | 70 |
| 71 // WebContentsModalDialogHost implementation. |
| 72 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; |
| 73 virtual void AddObserver( |
| 74 WebContentsModalDialogHostObserver* observer) OVERRIDE; |
| 75 virtual void RemoveObserver( |
| 76 WebContentsModalDialogHostObserver* observer) OVERRIDE; |
| 77 |
70 content::WebContents* web_contents() const { | 78 content::WebContents* web_contents() const { |
71 return shell_window_->web_contents(); | 79 return shell_window_->web_contents(); |
72 } | 80 } |
73 const extensions::Extension* extension() const { | 81 const extensions::Extension* extension() const { |
74 return shell_window_->extension(); | 82 return shell_window_->extension(); |
75 } | 83 } |
76 | 84 |
77 virtual ~NativeAppWindowGtk(); | 85 virtual ~NativeAppWindowGtk(); |
78 | 86 |
79 // If the point (|x|, |y|) is within the resize border area of the window, | 87 // If the point (|x|, |y|) is within the resize border area of the window, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 GdkCursor* frame_cursor_; | 141 GdkCursor* frame_cursor_; |
134 | 142 |
135 // The timer used to save the window position for session restore. | 143 // The timer used to save the window position for session restore. |
136 base::OneShotTimer<NativeAppWindowGtk> window_configure_debounce_timer_; | 144 base::OneShotTimer<NativeAppWindowGtk> window_configure_debounce_timer_; |
137 | 145 |
138 // The Extension Keybinding Registry responsible for registering listeners for | 146 // The Extension Keybinding Registry responsible for registering listeners for |
139 // accelerators that are sent to the window, that are destined to be turned | 147 // accelerators that are sent to the window, that are destined to be turned |
140 // into events and sent to the extension. | 148 // into events and sent to the extension. |
141 scoped_ptr<ExtensionKeybindingRegistryGtk> extension_keybinding_registry_; | 149 scoped_ptr<ExtensionKeybindingRegistryGtk> extension_keybinding_registry_; |
142 | 150 |
| 151 // Observers to be notified when any web contents modal dialog requires |
| 152 // updating its dimensions. |
| 153 ObserverList<WebContentsModalDialogHostObserver> observer_list_; |
| 154 |
143 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowGtk); | 155 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowGtk); |
144 }; | 156 }; |
145 | 157 |
146 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_NATIVE_APP_WINDOW_GTK_H_ | 158 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_NATIVE_APP_WINDOW_GTK_H_ |
OLD | NEW |