OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_BROWSER_TOOLBAR_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_BROWSER_TOOLBAR_VIEW_GTK_H_ |
| 7 |
| 8 #include "chrome/browser/command_updater.h" |
| 9 #include "chrome/common/pref_member.h" |
| 10 |
| 11 #include <gtk/gtk.h> |
| 12 |
| 13 class Browser; |
| 14 class Profile; |
| 15 class ToolbarModel; |
| 16 |
| 17 // View class that displays the GTK version of the toolbar and routes gtk |
| 18 // events back to the Browser. |
| 19 class BrowserToolbarGtk : public CommandUpdater::CommandObserver { |
| 20 public: |
| 21 explicit BrowserToolbarGtk(Browser* browser); |
| 22 virtual ~BrowserToolbarGtk(); |
| 23 |
| 24 // Create the contents of the toolbar |
| 25 void Init(Profile* profile); |
| 26 |
| 27 // Adds this GTK toolbar into a sizing box. |
| 28 void AddToolbarToBox(GtkWidget* box); |
| 29 |
| 30 // Overridden from CommandUpdater::CommandObserver: |
| 31 virtual void EnabledStateChangedForCommand(int id, bool enabled); |
| 32 |
| 33 void SetProfile(Profile* profile); |
| 34 |
| 35 private: |
| 36 // Builds a GtkButton with all the properties set. |
| 37 GtkWidget* BuildToolbarButton(const std::wstring& localized_tooltip); |
| 38 |
| 39 // Gtk callback for the "clicked" signal. |
| 40 static void ButtonClickCallback(GtkWidget* button, |
| 41 BrowserToolbarGtk* toolbar); |
| 42 |
| 43 // Gtk widgets. The toolbar is an hbox with each of the other pieces of the |
| 44 // toolbar placed side by side. |
| 45 GtkWidget* toolbar_; |
| 46 |
| 47 // Tooltip container for all GTK widgets in this class. |
| 48 GtkTooltips* toolbar_tooltips_; |
| 49 |
| 50 // All the GTK buttons in the toolbar. |
| 51 GtkWidget* back_; |
| 52 GtkWidget* forward_; |
| 53 GtkWidget* reload_; |
| 54 GtkWidget* home_; |
| 55 GtkWidget* star_; |
| 56 GtkWidget* go_; |
| 57 GtkWidget* page_menu_; |
| 58 GtkWidget* app_menu_; |
| 59 |
| 60 // The model that contains the security level, text, icon to display... |
| 61 ToolbarModel* model_; |
| 62 |
| 63 // TODO(port): Port BackForwardMenuModel |
| 64 // scoped_ptr<BackForwardMenuModel> back_menu_model_; |
| 65 // scoped_ptr<BackForwardMenuModel> forward_menu_model_; |
| 66 |
| 67 Browser* browser_; |
| 68 Profile* profile_; |
| 69 |
| 70 // Controls whether or not a home button should be shown on the toolbar. |
| 71 BooleanPrefMember show_home_button_; |
| 72 }; |
| 73 |
| 74 #endif |
OLD | NEW |