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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // it needs to manipulate the window. | 47 // it needs to manipulate the window. |
48 | 48 |
49 class BrowserWindowGtk : public BrowserWindow, | 49 class BrowserWindowGtk : public BrowserWindow, |
50 public NotificationObserver, | 50 public NotificationObserver, |
51 public TabStripModelObserver, | 51 public TabStripModelObserver, |
52 public ActiveWindowWatcherX::Observer { | 52 public ActiveWindowWatcherX::Observer { |
53 public: | 53 public: |
54 explicit BrowserWindowGtk(Browser* browser); | 54 explicit BrowserWindowGtk(Browser* browser); |
55 virtual ~BrowserWindowGtk(); | 55 virtual ~BrowserWindowGtk(); |
56 | 56 |
57 Browser* browser() const { return browser_.get(); } | |
58 | |
59 // Process a keyboard event which was not handled by webkit. | 57 // Process a keyboard event which was not handled by webkit. |
60 bool HandleKeyboardEvent(GdkEventKey* event); | 58 bool HandleKeyboardEvent(GdkEventKey* event); |
61 | 59 |
62 // Overridden from BrowserWindow | 60 // Overridden from BrowserWindow |
63 virtual void Show(); | 61 virtual void Show(); |
64 virtual void SetBounds(const gfx::Rect& bounds); | 62 virtual void SetBounds(const gfx::Rect& bounds); |
65 virtual void Close(); | 63 virtual void Close(); |
66 virtual void Activate(); | 64 virtual void Activate(); |
67 virtual bool IsActive() const; | 65 virtual bool IsActive() const; |
68 virtual void FlashFrame(); | 66 virtual void FlashFrame(); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void ResetCustomFrameCursor(); | 183 void ResetCustomFrameCursor(); |
186 | 184 |
187 // Returns the BrowserWindowGtk registered with |window|. | 185 // Returns the BrowserWindowGtk registered with |window|. |
188 static BrowserWindowGtk* GetBrowserWindowForNativeWindow( | 186 static BrowserWindowGtk* GetBrowserWindowForNativeWindow( |
189 gfx::NativeWindow window); | 187 gfx::NativeWindow window); |
190 | 188 |
191 // Retrieves the GtkWindow associated with |xid|, which is the X Window | 189 // Retrieves the GtkWindow associated with |xid|, which is the X Window |
192 // ID of the top-level X window of this object. | 190 // ID of the top-level X window of this object. |
193 static GtkWindow* GetBrowserWindowForXID(XID xid); | 191 static GtkWindow* GetBrowserWindowForXID(XID xid); |
194 | 192 |
195 Browser* browser() { | 193 Browser* browser() const { return browser_.get(); } |
196 return browser_.get(); | |
197 } | |
198 | 194 |
199 GtkWindow* window() const { return window_; } | 195 GtkWindow* window() const { return window_; } |
200 | 196 |
201 gfx::Rect bounds() const { return bounds_; } | 197 gfx::Rect bounds() const { return bounds_; } |
202 | 198 |
203 // Make changes necessary when the floating state of the bookmark bar changes. | 199 // Make changes necessary when the floating state of the bookmark bar changes. |
204 // This should only be called by the bookmark bar itself. | 200 // This should only be called by the bookmark bar itself. |
205 void BookmarkBarIsFloating(bool is_floating); | 201 void BookmarkBarIsFloating(bool is_floating); |
206 | 202 |
207 static void RegisterUserPrefs(PrefService* prefs); | 203 static void RegisterUserPrefs(PrefService* prefs); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 // first time. This is to work around a compiz bug. | 420 // first time. This is to work around a compiz bug. |
425 bool maximize_after_show_; | 421 bool maximize_after_show_; |
426 | 422 |
427 // The accelerator group used to handle accelerators, owned by this object. | 423 // The accelerator group used to handle accelerators, owned by this object. |
428 GtkAccelGroup* accel_group_; | 424 GtkAccelGroup* accel_group_; |
429 | 425 |
430 DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk); | 426 DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk); |
431 }; | 427 }; |
432 | 428 |
433 #endif // CHROME_BROWSER_GTK_BROWSER_WINDOW_GTK_H_ | 429 #endif // CHROME_BROWSER_GTK_BROWSER_WINDOW_GTK_H_ |
OLD | NEW |