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

Unified Diff: chrome/browser/gtk/browser_toolbar_view_gtk.h

Issue 21176: Porting the toolbar to GTK. (Closed)
Patch Set: Move into gtk/ folder at Ben's request. Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/browser_main_gtk.cc ('k') | chrome/browser/gtk/browser_toolbar_view_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/browser_toolbar_view_gtk.h
diff --git a/chrome/browser/gtk/browser_toolbar_view_gtk.h b/chrome/browser/gtk/browser_toolbar_view_gtk.h
new file mode 100644
index 0000000000000000000000000000000000000000..673bc10ae3faf8ce4dc3a2b5459426b417020af1
--- /dev/null
+++ b/chrome/browser/gtk/browser_toolbar_view_gtk.h
@@ -0,0 +1,74 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_BROWSER_TOOLBAR_VIEW_GTK_H_
+#define CHROME_BROWSER_BROWSER_TOOLBAR_VIEW_GTK_H_
+
+#include "chrome/browser/command_updater.h"
+#include "chrome/common/pref_member.h"
+
+#include <gtk/gtk.h>
+
+class Browser;
+class Profile;
+class ToolbarModel;
+
+// View class that displays the GTK version of the toolbar and routes gtk
+// events back to the Browser.
+class BrowserToolbarGtk : public CommandUpdater::CommandObserver {
+ public:
+ explicit BrowserToolbarGtk(Browser* browser);
+ virtual ~BrowserToolbarGtk();
+
+ // Create the contents of the toolbar
+ void Init(Profile* profile);
+
+ // Adds this GTK toolbar into a sizing box.
+ void AddToolbarToBox(GtkWidget* box);
+
+ // Overridden from CommandUpdater::CommandObserver:
+ virtual void EnabledStateChangedForCommand(int id, bool enabled);
+
+ void SetProfile(Profile* profile);
+
+ private:
+ // Builds a GtkButton with all the properties set.
+ GtkWidget* BuildToolbarButton(const std::wstring& localized_tooltip);
+
+ // Gtk callback for the "clicked" signal.
+ static void ButtonClickCallback(GtkWidget* button,
+ BrowserToolbarGtk* toolbar);
+
+ // Gtk widgets. The toolbar is an hbox with each of the other pieces of the
+ // toolbar placed side by side.
+ GtkWidget* toolbar_;
+
+ // Tooltip container for all GTK widgets in this class.
+ GtkTooltips* toolbar_tooltips_;
+
+ // All the GTK buttons in the toolbar.
+ GtkWidget* back_;
+ GtkWidget* forward_;
+ GtkWidget* reload_;
+ GtkWidget* home_;
+ GtkWidget* star_;
+ GtkWidget* go_;
+ GtkWidget* page_menu_;
+ GtkWidget* app_menu_;
+
+ // The model that contains the security level, text, icon to display...
+ ToolbarModel* model_;
+
+ // TODO(port): Port BackForwardMenuModel
+ // scoped_ptr<BackForwardMenuModel> back_menu_model_;
+ // scoped_ptr<BackForwardMenuModel> forward_menu_model_;
+
+ Browser* browser_;
+ Profile* profile_;
+
+ // Controls whether or not a home button should be shown on the toolbar.
+ BooleanPrefMember show_home_button_;
+};
+
+#endif
« no previous file with comments | « chrome/browser/gtk/browser_main_gtk.cc ('k') | chrome/browser/gtk/browser_toolbar_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698