Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Side by Side Diff: chrome/browser/ui/gtk/browser_toolbar_gtk.h

Issue 12039058: content: convert zoom notifications to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_BROWSER_TOOLBAR_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_
7 7
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/prefs/public/pref_member.h" 13 #include "base/prefs/public/pref_member.h"
14 #include "chrome/browser/command_observer.h" 14 #include "chrome/browser/command_observer.h"
15 #include "chrome/browser/ui/gtk/custom_button.h" 15 #include "chrome/browser/ui/gtk/custom_button.h"
16 #include "chrome/browser/ui/gtk/menu_gtk.h" 16 #include "chrome/browser/ui/gtk/menu_gtk.h"
17 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" 17 #include "chrome/browser/ui/toolbar/wrench_menu_model.h"
18 #include "content/public/browser/host_zoom_map.h"
18 #include "content/public/browser/notification_observer.h" 19 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_registrar.h" 20 #include "content/public/browser/notification_registrar.h"
20 #include "ui/base/accelerators/accelerator.h" 21 #include "ui/base/accelerators/accelerator.h"
21 #include "ui/base/gtk/gtk_signal.h" 22 #include "ui/base/gtk/gtk_signal.h"
22 #include "ui/base/gtk/gtk_signal_registrar.h" 23 #include "ui/base/gtk/gtk_signal_registrar.h"
23 #include "ui/base/gtk/owned_widget_gtk.h" 24 #include "ui/base/gtk/owned_widget_gtk.h"
24 #include "ui/base/models/simple_menu_model.h" 25 #include "ui/base/models/simple_menu_model.h"
25 26
26 class BackForwardButtonGtk; 27 class BackForwardButtonGtk;
27 class Browser; 28 class Browser;
28 class BrowserActionsToolbarGtk; 29 class BrowserActionsToolbarGtk;
29 class BrowserWindowGtk; 30 class BrowserWindowGtk;
30 class CustomDrawButton; 31 class CustomDrawButton;
31 class GtkThemeService; 32 class GtkThemeService;
32 class LocationBar; 33 class LocationBar;
33 class LocationBarViewGtk; 34 class LocationBarViewGtk;
34 class ReloadButtonGtk; 35 class ReloadButtonGtk;
35 class ToolbarModel; 36 class ToolbarModel;
36 37
37 namespace content { 38 namespace content {
38 class WebContents; 39 class WebContents;
39 } 40 }
40 41
41 // View class that displays the GTK version of the toolbar and routes gtk 42 // View class that displays the GTK version of the toolbar and routes gtk
42 // events back to the Browser. 43 // events back to the Browser.
43 class BrowserToolbarGtk : public CommandObserver, 44 class BrowserToolbarGtk : public CommandObserver,
44 public ui::AcceleratorProvider, 45 public ui::AcceleratorProvider,
45 public MenuGtk::Delegate, 46 public MenuGtk::Delegate,
47 public content::HostZoomMap::Observer,
46 public content::NotificationObserver { 48 public content::NotificationObserver {
47 public: 49 public:
48 BrowserToolbarGtk(Browser* browser, BrowserWindowGtk* window); 50 BrowserToolbarGtk(Browser* browser, BrowserWindowGtk* window);
49 virtual ~BrowserToolbarGtk(); 51 virtual ~BrowserToolbarGtk();
50 52
51 // Create the contents of the toolbar. |top_level_window| is the GtkWindow 53 // Create the contents of the toolbar. |top_level_window| is the GtkWindow
52 // to which we attach our accelerators. 54 // to which we attach our accelerators.
53 void Init(GtkWindow* top_level_window); 55 void Init(GtkWindow* top_level_window);
54 56
55 // Set the various widgets' ViewIDs. 57 // Set the various widgets' ViewIDs.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Overridden from MenuGtk::Delegate: 94 // Overridden from MenuGtk::Delegate:
93 virtual void StoppedShowing() OVERRIDE; 95 virtual void StoppedShowing() OVERRIDE;
94 virtual GtkIconSet* GetIconSetForId(int idr) OVERRIDE; 96 virtual GtkIconSet* GetIconSetForId(int idr) OVERRIDE;
95 virtual bool AlwaysShowIconForCmd(int command_id) const OVERRIDE; 97 virtual bool AlwaysShowIconForCmd(int command_id) const OVERRIDE;
96 98
97 // Overridden from ui::AcceleratorProvider: 99 // Overridden from ui::AcceleratorProvider:
98 virtual bool GetAcceleratorForCommandId( 100 virtual bool GetAcceleratorForCommandId(
99 int id, 101 int id,
100 ui::Accelerator* accelerator) OVERRIDE; 102 ui::Accelerator* accelerator) OVERRIDE;
101 103
104 // content::HostZoomMap::Observer implementation:
105 virtual void OnZoomLevelChanged(const std::string& host) OVERRIDE;
106
102 // content::NotificationObserver implementation. 107 // content::NotificationObserver implementation.
103 virtual void Observe(int type, 108 virtual void Observe(int type,
104 const content::NotificationSource& source, 109 const content::NotificationSource& source,
105 const content::NotificationDetails& details) OVERRIDE; 110 const content::NotificationDetails& details) OVERRIDE;
106 111
107 // Whether the wrench/hotdogs menu is currently visible to the user. 112 // Whether the wrench/hotdogs menu is currently visible to the user.
108 bool IsWrenchMenuShowing() const; 113 bool IsWrenchMenuShowing() const;
109 114
110 // Message that we should react to a state change. 115 // Message that we should react to a state change.
111 void UpdateWebContents(content::WebContents* contents, 116 void UpdateWebContents(content::WebContents* contents,
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // rendering. 222 // rendering.
218 ui::OwnedWidgetGtk offscreen_entry_; 223 ui::OwnedWidgetGtk offscreen_entry_;
219 224
220 // Manages the home button drop signal handler. 225 // Manages the home button drop signal handler.
221 scoped_ptr<ui::GtkSignalRegistrar> drop_handler_; 226 scoped_ptr<ui::GtkSignalRegistrar> drop_handler_;
222 227
223 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk); 228 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk);
224 }; 229 };
225 230
226 #endif // CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ 231 #endif // CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698