OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_WINDOW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/timer.h" | 16 #include "base/timer.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "chrome/browser/infobars/infobar_container.h" | 18 #include "chrome/browser/infobars/infobar_container.h" |
19 #include "chrome/browser/prefs/pref_member.h" | 19 #include "chrome/browser/prefs/pref_member.h" |
20 #include "chrome/browser/tabs/tab_strip_model_observer.h" | 20 #include "chrome/browser/tabs/tab_strip_model_observer.h" |
21 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
22 #include "ui/base/gtk/gtk_signal.h" | 22 #include "ui/base/gtk/gtk_signal.h" |
23 #include "ui/base/ui_base_types.h" | 23 #include "ui/base/ui_base_types.h" |
24 #include "ui/base/x/active_window_watcher_x.h" | 24 #include "ui/base/x/active_window_watcher_x_observer.h" |
25 #include "ui/base/x/x11_util.h" | 25 #include "ui/base/x/x11_util.h" |
26 #include "ui/gfx/rect.h" | 26 #include "ui/gfx/rect.h" |
27 | 27 |
28 class BookmarkBarGtk; | 28 class BookmarkBarGtk; |
29 class Browser; | 29 class Browser; |
30 class BrowserTitlebar; | 30 class BrowserTitlebar; |
31 class BrowserToolbarGtk; | 31 class BrowserToolbarGtk; |
32 class DownloadShelfGtk; | 32 class DownloadShelfGtk; |
33 class FindBarGtk; | 33 class FindBarGtk; |
34 class FullscreenExitBubbleGtk; | 34 class FullscreenExitBubbleGtk; |
35 class GlobalMenuBar; | 35 class GlobalMenuBar; |
36 class InfoBarContainerGtk; | 36 class InfoBarContainerGtk; |
37 class LocationBar; | 37 class LocationBar; |
38 class StatusBubbleGtk; | 38 class StatusBubbleGtk; |
39 class TabContentsContainerGtk; | 39 class TabContentsContainerGtk; |
40 class TabStripGtk; | 40 class TabStripGtk; |
41 | 41 |
42 // An implementation of BrowserWindow for GTK. | 42 // An implementation of BrowserWindow for GTK. |
43 // Cross-platform code will interact with this object when | 43 // Cross-platform code will interact with this object when |
44 // it needs to manipulate the window. | 44 // it needs to manipulate the window. |
45 | 45 |
46 class BrowserWindowGtk : public BrowserWindow, | 46 class BrowserWindowGtk : public BrowserWindow, |
47 public content::NotificationObserver, | 47 public content::NotificationObserver, |
48 public TabStripModelObserver, | 48 public TabStripModelObserver, |
49 public ui::ActiveWindowWatcherX::Observer, | 49 public ui::ActiveWindowWatcherXObserver, |
50 public InfoBarContainer::Delegate { | 50 public InfoBarContainer::Delegate { |
51 public: | 51 public: |
52 enum TitleDecoration { | 52 enum TitleDecoration { |
53 PANGO_MARKUP, | 53 PANGO_MARKUP, |
54 PLAIN_TEXT | 54 PLAIN_TEXT |
55 }; | 55 }; |
56 | 56 |
57 explicit BrowserWindowGtk(Browser* browser); | 57 explicit BrowserWindowGtk(Browser* browser); |
58 virtual ~BrowserWindowGtk(); | 58 virtual ~BrowserWindowGtk(); |
59 | 59 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 const content::NotificationSource& source, | 164 const content::NotificationSource& source, |
165 const content::NotificationDetails& details) OVERRIDE; | 165 const content::NotificationDetails& details) OVERRIDE; |
166 | 166 |
167 // Overridden from TabStripModelObserver: | 167 // Overridden from TabStripModelObserver: |
168 virtual void TabDetachedAt(TabContentsWrapper* contents, int index) OVERRIDE; | 168 virtual void TabDetachedAt(TabContentsWrapper* contents, int index) OVERRIDE; |
169 virtual void ActiveTabChanged(TabContentsWrapper* old_contents, | 169 virtual void ActiveTabChanged(TabContentsWrapper* old_contents, |
170 TabContentsWrapper* new_contents, | 170 TabContentsWrapper* new_contents, |
171 int index, | 171 int index, |
172 bool user_gesture) OVERRIDE; | 172 bool user_gesture) OVERRIDE; |
173 | 173 |
174 // Overridden from ActiveWindowWatcher::Observer. | 174 // Overridden from ActiveWindowWatcherXObserver. |
175 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; | 175 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; |
176 | 176 |
177 // Overridden from InfoBarContainer::Delegate: | 177 // Overridden from InfoBarContainer::Delegate: |
178 virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE; | 178 virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE; |
179 virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE; | 179 virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE; |
180 virtual bool DrawInfoBarArrows(int* x) const OVERRIDE; | 180 virtual bool DrawInfoBarArrows(int* x) const OVERRIDE; |
181 | 181 |
182 // Accessor for the tab strip. | 182 // Accessor for the tab strip. |
183 TabStripGtk* tabstrip() const { return tabstrip_.get(); } | 183 TabStripGtk* tabstrip() const { return tabstrip_.get(); } |
184 | 184 |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 // be called. This should only be enabled in tests where the debounce timeout | 527 // be called. This should only be enabled in tests where the debounce timeout |
528 // introduces timing issues (e.g. in OmniBoxApiTest it dismisses the | 528 // introduces timing issues (e.g. in OmniBoxApiTest it dismisses the |
529 // autocomplete popup before the results can be read) and the final window | 529 // autocomplete popup before the results can be read) and the final window |
530 // position is unimportant. | 530 // position is unimportant. |
531 bool debounce_timer_disabled_; | 531 bool debounce_timer_disabled_; |
532 | 532 |
533 DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk); | 533 DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk); |
534 }; | 534 }; |
535 | 535 |
536 #endif // CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_ | 536 #endif // CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_ |
OLD | NEW |