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 "apps/shell_window.h" | 10 #include "apps/shell_window.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
13 #include "chrome/browser/ui/extensions/native_app_window.h" | 13 #include "chrome/browser/ui/extensions/native_app_window.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 "third_party/skia/include/core/SkRegion.h" | 15 #include "third_party/skia/include/core/SkRegion.h" |
16 #include "ui/base/gtk/gtk_signal.h" | 16 #include "ui/base/gtk/gtk_signal.h" |
17 #include "ui/base/x/active_window_watcher_x_observer.h" | 17 #include "ui/base/x/active_window_watcher_x_observer.h" |
| 18 #include "ui/base/x/x11_atom_cache.h" |
18 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
19 | 20 |
20 class ExtensionKeybindingRegistryGtk; | 21 class ExtensionKeybindingRegistryGtk; |
21 class Profile; | 22 class Profile; |
22 | 23 |
23 namespace extensions { | 24 namespace extensions { |
24 class Extension; | 25 class Extension; |
25 } | 26 } |
26 | 27 |
27 class NativeAppWindowGtk : public NativeAppWindow, | 28 class NativeAppWindowGtk : public NativeAppWindow, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 CHROMEGTK_CALLBACK_1(NativeAppWindowGtk, gboolean, OnMainWindowDeleteEvent, | 96 CHROMEGTK_CALLBACK_1(NativeAppWindowGtk, gboolean, OnMainWindowDeleteEvent, |
96 GdkEvent*); | 97 GdkEvent*); |
97 CHROMEGTK_CALLBACK_1(NativeAppWindowGtk, gboolean, OnConfigure, | 98 CHROMEGTK_CALLBACK_1(NativeAppWindowGtk, gboolean, OnConfigure, |
98 GdkEventConfigure*); | 99 GdkEventConfigure*); |
99 CHROMEGTK_CALLBACK_1(NativeAppWindowGtk, gboolean, OnWindowState, | 100 CHROMEGTK_CALLBACK_1(NativeAppWindowGtk, gboolean, OnWindowState, |
100 GdkEventWindowState*); | 101 GdkEventWindowState*); |
101 CHROMEGTK_CALLBACK_1(NativeAppWindowGtk, gboolean, OnMouseMoveEvent, | 102 CHROMEGTK_CALLBACK_1(NativeAppWindowGtk, gboolean, OnMouseMoveEvent, |
102 GdkEventMotion*); | 103 GdkEventMotion*); |
103 CHROMEGTK_CALLBACK_1(NativeAppWindowGtk, gboolean, OnButtonPress, | 104 CHROMEGTK_CALLBACK_1(NativeAppWindowGtk, gboolean, OnButtonPress, |
104 GdkEventButton*); | 105 GdkEventButton*); |
| 106 // Callback for PropertyChange XEvents. |
| 107 CHROMEG_CALLBACK_1(NativeAppWindowGtk, GdkFilterReturn, |
| 108 OnXEvent, GdkXEvent*, GdkEvent*); |
105 | 109 |
106 void OnConfigureDebounced(); | 110 void OnConfigureDebounced(); |
107 | 111 |
108 apps::ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow. | 112 apps::ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow. |
109 | 113 |
110 GtkWindow* window_; | 114 GtkWindow* window_; |
111 GdkWindowState state_; | 115 GdkWindowState state_; |
112 | 116 |
113 // True if the window manager thinks the window is active. Not all window | 117 // True if the window manager thinks the window is active. Not all window |
114 // managers keep track of this state (_NET_ACTIVE_WINDOW), in which case | 118 // managers keep track of this state (_NET_ACTIVE_WINDOW), in which case |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 152 |
149 // The Extension Keybinding Registry responsible for registering listeners for | 153 // The Extension Keybinding Registry responsible for registering listeners for |
150 // accelerators that are sent to the window, that are destined to be turned | 154 // accelerators that are sent to the window, that are destined to be turned |
151 // into events and sent to the extension. | 155 // into events and sent to the extension. |
152 scoped_ptr<ExtensionKeybindingRegistryGtk> extension_keybinding_registry_; | 156 scoped_ptr<ExtensionKeybindingRegistryGtk> extension_keybinding_registry_; |
153 | 157 |
154 // Observers to be notified when any web contents modal dialog requires | 158 // Observers to be notified when any web contents modal dialog requires |
155 // updating its dimensions. | 159 // updating its dimensions. |
156 ObserverList<web_modal::WebContentsModalDialogHostObserver> observer_list_; | 160 ObserverList<web_modal::WebContentsModalDialogHostObserver> observer_list_; |
157 | 161 |
| 162 ui::X11AtomCache atom_cache_; |
| 163 |
| 164 // True if we listen for the XEvent. |
| 165 bool is_x_event_listened_; |
| 166 |
158 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowGtk); | 167 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowGtk); |
159 }; | 168 }; |
160 | 169 |
161 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_NATIVE_APP_WINDOW_GTK_H_ | 170 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_NATIVE_APP_WINDOW_GTK_H_ |
OLD | NEW |