| 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_VIEWS_TOOLBAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 public CommandUpdater::CommandObserver, | 39 public CommandUpdater::CommandObserver, |
| 40 public views::ButtonListener { | 40 public views::ButtonListener { |
| 41 public: | 41 public: |
| 42 // The view class name. | 42 // The view class name. |
| 43 static char kViewClassName[]; | 43 static char kViewClassName[]; |
| 44 | 44 |
| 45 explicit ToolbarView(Browser* browser); | 45 explicit ToolbarView(Browser* browser); |
| 46 virtual ~ToolbarView(); | 46 virtual ~ToolbarView(); |
| 47 | 47 |
| 48 // Create the contents of the Browser Toolbar | 48 // Create the contents of the Browser Toolbar |
| 49 void Init(Profile* profile); | 49 void Init(); |
| 50 | |
| 51 // Sets the profile which is active on the currently-active tab. | |
| 52 void SetProfile(Profile* profile); | |
| 53 Profile* profile() { return profile_; } | |
| 54 | 50 |
| 55 // Updates the toolbar (and transitively the location bar) with the states of | 51 // Updates the toolbar (and transitively the location bar) with the states of |
| 56 // the specified |tab|. If |should_restore_state| is true, we're switching | 52 // the specified |tab|. If |should_restore_state| is true, we're switching |
| 57 // (back?) to this tab and should restore any previous location bar state | 53 // (back?) to this tab and should restore any previous location bar state |
| 58 // (such as user editing) as well. | 54 // (such as user editing) as well. |
| 59 void Update(TabContents* tab, bool should_restore_state); | 55 void Update(TabContents* tab, bool should_restore_state); |
| 60 | 56 |
| 61 // Set focus to the toolbar with complete keyboard access, with the | 57 // Set focus to the toolbar with complete keyboard access, with the |
| 62 // focus initially set to the location bar. Focus will be restored | 58 // focus initially set to the location bar. Focus will be restored |
| 63 // to the ViewStorage with id |view_storage_id| if the user escapes. | 59 // to the ViewStorage with id |view_storage_id| if the user escapes. |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 ToolbarModel* model_; | 180 ToolbarModel* model_; |
| 185 | 181 |
| 186 // Controls | 182 // Controls |
| 187 views::ImageButton* back_; | 183 views::ImageButton* back_; |
| 188 views::ImageButton* forward_; | 184 views::ImageButton* forward_; |
| 189 ReloadButton* reload_; | 185 ReloadButton* reload_; |
| 190 views::ImageButton* home_; | 186 views::ImageButton* home_; |
| 191 LocationBarView* location_bar_; | 187 LocationBarView* location_bar_; |
| 192 BrowserActionsContainer* browser_actions_; | 188 BrowserActionsContainer* browser_actions_; |
| 193 views::MenuButton* app_menu_; | 189 views::MenuButton* app_menu_; |
| 194 Profile* profile_; | |
| 195 Browser* browser_; | 190 Browser* browser_; |
| 196 | 191 |
| 197 // Contents of the profiles menu to populate with profile names. | 192 // Contents of the profiles menu to populate with profile names. |
| 198 scoped_ptr<ui::SimpleMenuModel> profiles_menu_contents_; | 193 scoped_ptr<ui::SimpleMenuModel> profiles_menu_contents_; |
| 199 | 194 |
| 200 // Controls whether or not a home button should be shown on the toolbar. | 195 // Controls whether or not a home button should be shown on the toolbar. |
| 201 BooleanPrefMember show_home_button_; | 196 BooleanPrefMember show_home_button_; |
| 202 | 197 |
| 203 // The display mode used when laying out the toolbar. | 198 // The display mode used when laying out the toolbar. |
| 204 DisplayMode display_mode_; | 199 DisplayMode display_mode_; |
| 205 | 200 |
| 206 // The contents of the wrench menu. | 201 // The contents of the wrench menu. |
| 207 scoped_ptr<ui::SimpleMenuModel> wrench_menu_model_; | 202 scoped_ptr<ui::SimpleMenuModel> wrench_menu_model_; |
| 208 | 203 |
| 209 // Wrench menu. | 204 // Wrench menu. |
| 210 scoped_refptr<WrenchMenu> wrench_menu_; | 205 scoped_refptr<WrenchMenu> wrench_menu_; |
| 211 | 206 |
| 212 // Vector of listeners to receive callbacks when the menu opens. | 207 // Vector of listeners to receive callbacks when the menu opens. |
| 213 std::vector<views::MenuListener*> menu_listeners_; | 208 std::vector<views::MenuListener*> menu_listeners_; |
| 214 | 209 |
| 215 NotificationRegistrar registrar_; | 210 NotificationRegistrar registrar_; |
| 216 | 211 |
| 217 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); | 212 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); |
| 218 }; | 213 }; |
| 219 | 214 |
| 220 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_VIEW_H_ | 215 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_VIEW_H_ |
| OLD | NEW |