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

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

Issue 10677009: Move command handling and updating off Browser and onto a helper object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 #pragma once 7 #pragma once
8 8
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 #include <string> 10 #include <string>
(...skipping 23 matching lines...) Expand all
34 class LocationBarViewGtk; 34 class LocationBarViewGtk;
35 class ReloadButtonGtk; 35 class ReloadButtonGtk;
36 class ToolbarModel; 36 class ToolbarModel;
37 37
38 namespace content { 38 namespace content {
39 class WebContents; 39 class WebContents;
40 } 40 }
41 41
42 // 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
43 // events back to the Browser. 43 // events back to the Browser.
44 class BrowserToolbarGtk : public CommandUpdater::CommandObserver, 44 class BrowserToolbarGtk : public CommandObserver,
45 public ui::AcceleratorProvider, 45 public ui::AcceleratorProvider,
46 public MenuGtk::Delegate, 46 public MenuGtk::Delegate,
47 public content::NotificationObserver { 47 public content::NotificationObserver {
48 public: 48 public:
49 BrowserToolbarGtk(Browser* browser, BrowserWindowGtk* window); 49 BrowserToolbarGtk(Browser* browser, BrowserWindowGtk* window);
50 virtual ~BrowserToolbarGtk(); 50 virtual ~BrowserToolbarGtk();
51 51
52 // Create the contents of the toolbar. |top_level_window| is the GtkWindow 52 // Create the contents of the toolbar. |top_level_window| is the GtkWindow
53 // to which we attach our accelerators. 53 // to which we attach our accelerators.
54 void Init(GtkWindow* top_level_window); 54 void Init(GtkWindow* top_level_window);
(...skipping 25 matching lines...) Expand all
80 } 80 }
81 81
82 LocationBarViewGtk* GetLocationBarView() { return location_bar_.get(); } 82 LocationBarViewGtk* GetLocationBarView() { return location_bar_.get(); }
83 83
84 // We have to show padding on the bottom of the toolbar when the bookmark 84 // We have to show padding on the bottom of the toolbar when the bookmark
85 // is in floating mode. Otherwise the bookmark bar will paint it for us. 85 // is in floating mode. Otherwise the bookmark bar will paint it for us.
86 void UpdateForBookmarkBarVisibility(bool show_bottom_padding); 86 void UpdateForBookmarkBarVisibility(bool show_bottom_padding);
87 87
88 void ShowAppMenu(); 88 void ShowAppMenu();
89 89
90 // Overridden from CommandUpdater::CommandObserver: 90 // Overridden from CommandObserver:
91 virtual void EnabledStateChangedForCommand(int id, bool enabled) OVERRIDE; 91 virtual void EnabledStateChangedForCommand(int id, bool enabled) OVERRIDE;
92 92
93 // Overridden from MenuGtk::Delegate: 93 // Overridden from MenuGtk::Delegate:
94 virtual void StoppedShowing() OVERRIDE; 94 virtual void StoppedShowing() OVERRIDE;
95 virtual GtkIconSet* GetIconSetForId(int idr) OVERRIDE; 95 virtual GtkIconSet* GetIconSetForId(int idr) OVERRIDE;
96 virtual bool AlwaysShowIconForCmd(int command_id) const OVERRIDE; 96 virtual bool AlwaysShowIconForCmd(int command_id) const OVERRIDE;
97 97
98 // Overridden from ui::AcceleratorProvider: 98 // Overridden from ui::AcceleratorProvider:
99 virtual bool GetAcceleratorForCommandId( 99 virtual bool GetAcceleratorForCommandId(
100 int id, 100 int id,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // rendering. 216 // rendering.
217 ui::OwnedWidgetGtk offscreen_entry_; 217 ui::OwnedWidgetGtk offscreen_entry_;
218 218
219 // Manages the home button drop signal handler. 219 // Manages the home button drop signal handler.
220 scoped_ptr<ui::GtkSignalRegistrar> drop_handler_; 220 scoped_ptr<ui::GtkSignalRegistrar> drop_handler_;
221 221
222 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk); 222 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk);
223 }; 223 };
224 224
225 #endif // CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ 225 #endif // CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698