| 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 "chrome/browser/ui/extensions/native_shell_window.h" | 11 #include "chrome/browser/ui/extensions/native_shell_window.h" |
| 11 #include "chrome/browser/ui/extensions/shell_window.h" | 12 #include "chrome/browser/ui/extensions/shell_window.h" |
| 12 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" | 13 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" |
| 13 #include "ui/base/gtk/gtk_signal.h" | 14 #include "ui/base/gtk/gtk_signal.h" |
| 14 #include "ui/base/x/active_window_watcher_x_observer.h" | 15 #include "ui/base/x/active_window_watcher_x_observer.h" |
| 15 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 16 | 17 |
| 17 class Profile; | 18 class Profile; |
| 18 | 19 |
| 19 namespace extensions { | 20 namespace extensions { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 66 |
| 66 virtual ~ShellWindowGtk(); | 67 virtual ~ShellWindowGtk(); |
| 67 | 68 |
| 68 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnMainWindowDeleteEvent, | 69 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnMainWindowDeleteEvent, |
| 69 GdkEvent*); | 70 GdkEvent*); |
| 70 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnConfigure, | 71 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnConfigure, |
| 71 GdkEventConfigure*); | 72 GdkEventConfigure*); |
| 72 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnWindowState, | 73 CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnWindowState, |
| 73 GdkEventWindowState*); | 74 GdkEventWindowState*); |
| 74 | 75 |
| 76 void OnDebouncedBoundsChanged(); |
| 77 |
| 75 ShellWindow* shell_window_; // weak - ShellWindow owns NativeShellWindow. | 78 ShellWindow* shell_window_; // weak - ShellWindow owns NativeShellWindow. |
| 76 | 79 |
| 77 GtkWindow* window_; | 80 GtkWindow* window_; |
| 78 GdkWindowState state_; | 81 GdkWindowState state_; |
| 79 | 82 |
| 80 // True if the window manager thinks the window is active. Not all window | 83 // True if the window manager thinks the window is active. Not all window |
| 81 // managers keep track of this state (_NET_ACTIVE_WINDOW), in which case | 84 // managers keep track of this state (_NET_ACTIVE_WINDOW), in which case |
| 82 // this will always be true. | 85 // this will always be true. |
| 83 bool is_active_; | 86 bool is_active_; |
| 84 | 87 |
| 85 // The position and size of the current window. | 88 // The position and size of the current window. |
| 86 gfx::Rect bounds_; | 89 gfx::Rect bounds_; |
| 87 | 90 |
| 88 // The position and size of the non-maximized, non-fullscreen window. | 91 // The position and size of the non-maximized, non-fullscreen window. |
| 89 gfx::Rect restored_bounds_; | 92 gfx::Rect restored_bounds_; |
| 90 | 93 |
| 91 // True if the RVH is in fullscreen mode. The window may not actually be in | 94 // True if the RVH is in fullscreen mode. The window may not actually be in |
| 92 // fullscreen, however: some WMs don't support fullscreen. | 95 // fullscreen, however: some WMs don't support fullscreen. |
| 93 bool content_thinks_its_fullscreen_; | 96 bool content_thinks_its_fullscreen_; |
| 94 | 97 |
| 98 // The timer used to save the window position for session restore. |
| 99 base::OneShotTimer<ShellWindowGtk> window_configure_debounce_timer_; |
| 100 |
| 95 DISALLOW_COPY_AND_ASSIGN(ShellWindowGtk); | 101 DISALLOW_COPY_AND_ASSIGN(ShellWindowGtk); |
| 96 }; | 102 }; |
| 97 | 103 |
| 98 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_SHELL_WINDOW_GTK_H_ | 104 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_SHELL_WINDOW_GTK_H_ |
| OLD | NEW |