OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_GTK_BROWSER_WINDOW_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_BROWSER_WINDOW_GTK_H_ |
6 #define CHROME_BROWSER_GTK_BROWSER_WINDOW_GTK_H_ | 6 #define CHROME_BROWSER_GTK_BROWSER_WINDOW_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 14 matching lines...) Expand all Loading... |
25 class BrowserToolbarGtk; | 25 class BrowserToolbarGtk; |
26 class CustomDrawButton; | 26 class CustomDrawButton; |
27 class DownloadShelfGtk; | 27 class DownloadShelfGtk; |
28 class FindBarGtk; | 28 class FindBarGtk; |
29 class InfoBarContainerGtk; | 29 class InfoBarContainerGtk; |
30 class LocationBar; | 30 class LocationBar; |
31 class StatusBubbleGtk; | 31 class StatusBubbleGtk; |
32 class TabContentsContainerGtk; | 32 class TabContentsContainerGtk; |
33 class TabStripGtk; | 33 class TabStripGtk; |
34 | 34 |
35 #ifdef LINUX2 | 35 #ifdef OS_CHROMEOS |
36 class PanelController; | 36 class PanelController; |
37 #endif | 37 #endif |
38 | 38 |
39 // An implementation of BrowserWindow for GTK. | 39 // An implementation of BrowserWindow for GTK. |
40 // Cross-platform code will interact with this object when | 40 // Cross-platform code will interact with this object when |
41 // it needs to manipulate the window. | 41 // it needs to manipulate the window. |
42 | 42 |
43 class BrowserWindowGtk : public BrowserWindow, | 43 class BrowserWindowGtk : public BrowserWindow, |
44 public NotificationObserver, | 44 public NotificationObserver, |
45 public TabStripModelObserver { | 45 public TabStripModelObserver { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 // Returns false if we're not ready to close yet. E.g., a tab may have an | 126 // Returns false if we're not ready to close yet. E.g., a tab may have an |
127 // onbeforeunload handler that prevents us from closing. | 127 // onbeforeunload handler that prevents us from closing. |
128 bool CanClose() const; | 128 bool CanClose() const; |
129 | 129 |
130 bool ShouldShowWindowIcon() const; | 130 bool ShouldShowWindowIcon() const; |
131 | 131 |
132 // Add the find bar widget to the window hierarchy. | 132 // Add the find bar widget to the window hierarchy. |
133 void AddFindBar(FindBarGtk* findbar); | 133 void AddFindBar(FindBarGtk* findbar); |
134 | 134 |
135 #if defined(LINUX2) | 135 #if defined(OS_CHROMEOS) |
136 // Sets whether a drag is active. If a drag is active the window will not | 136 // Sets whether a drag is active. If a drag is active the window will not |
137 // close. | 137 // close. |
138 void set_drag_active(bool drag_active) { drag_active_ = drag_active; } | 138 void set_drag_active(bool drag_active) { drag_active_ = drag_active; } |
139 #endif | 139 #endif |
140 | 140 |
141 // Reset the mouse cursor to the default cursor if it was set to something | 141 // Reset the mouse cursor to the default cursor if it was set to something |
142 // else for the custom frame. | 142 // else for the custom frame. |
143 void ResetCustomFrameCursor(); | 143 void ResetCustomFrameCursor(); |
144 | 144 |
145 // Returns the BrowserWindowGtk registered with |window|. | 145 // Returns the BrowserWindowGtk registered with |window|. |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 // The container for info bars. Always non-NULL. | 289 // The container for info bars. Always non-NULL. |
290 scoped_ptr<InfoBarContainerGtk> infobar_container_; | 290 scoped_ptr<InfoBarContainerGtk> infobar_container_; |
291 | 291 |
292 // The timer used to update frames for the Loading Animation. | 292 // The timer used to update frames for the Loading Animation. |
293 base::RepeatingTimer<BrowserWindowGtk> loading_animation_timer_; | 293 base::RepeatingTimer<BrowserWindowGtk> loading_animation_timer_; |
294 | 294 |
295 // Whether we're showing the custom chrome frame or the window manager | 295 // Whether we're showing the custom chrome frame or the window manager |
296 // decorations. | 296 // decorations. |
297 BooleanPrefMember use_custom_frame_; | 297 BooleanPrefMember use_custom_frame_; |
298 | 298 |
299 #if defined(LINUX2) | 299 #if defined(OS_CHROMEOS) |
300 // True if a drag is active. See description above setter for details. | 300 // True if a drag is active. See description above setter for details. |
301 bool drag_active_; | 301 bool drag_active_; |
302 // Controls interactions with the window manager for popup panels. | 302 // Controls interactions with the window manager for popup panels. |
303 PanelController* panel_controller_; | 303 PanelController* panel_controller_; |
304 #endif | 304 #endif |
305 | 305 |
306 // A map which translates an X Window ID into its respective GtkWindow. | 306 // A map which translates an X Window ID into its respective GtkWindow. |
307 static std::map<XID, GtkWindow*> xid_map_; | 307 static std::map<XID, GtkWindow*> xid_map_; |
308 | 308 |
309 // The current window cursor. We set it to a resize cursor when over the | 309 // The current window cursor. We set it to a resize cursor when over the |
310 // custom frame border. We set it to NULL if we want the default cursor. | 310 // custom frame border. We set it to NULL if we want the default cursor. |
311 GdkCursor* frame_cursor_; | 311 GdkCursor* frame_cursor_; |
312 | 312 |
313 DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk); | 313 DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk); |
314 }; | 314 }; |
315 | 315 |
316 #endif // CHROME_BROWSER_GTK_BROWSER_WINDOW_GTK_H_ | 316 #endif // CHROME_BROWSER_GTK_BROWSER_WINDOW_GTK_H_ |
OLD | NEW |