| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_VIEWS_TOOLBAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/menus/simple_menu_model.h" | 10 #include "app/menus/simple_menu_model.h" |
| 11 #include "app/slide_animation.h" | 11 #include "app/slide_animation.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "chrome/browser/back_forward_menu_model.h" | 13 #include "chrome/browser/back_forward_menu_model.h" |
| 14 #include "chrome/browser/command_updater.h" | 14 #include "chrome/browser/command_updater.h" |
| 15 #include "chrome/browser/pref_member.h" | 15 #include "chrome/browser/pref_member.h" |
| 16 #include "chrome/browser/views/accessible_toolbar_view.h" | 16 #include "chrome/browser/views/accessible_toolbar_view.h" |
| 17 #include "chrome/browser/views/location_bar/location_bar_view.h" | 17 #include "chrome/browser/views/location_bar/location_bar_view.h" |
| 18 #include "chrome/browser/views/reload_button.h" | 18 #include "chrome/browser/views/reload_button.h" |
| 19 #include "views/controls/button/menu_button.h" | 19 #include "views/controls/button/menu_button.h" |
| 20 #include "views/controls/menu/menu.h" | 20 #include "views/controls/menu/menu.h" |
| 21 #include "views/controls/menu/menu_wrapper.h" | 21 #include "views/controls/menu/menu_wrapper.h" |
| 22 #include "views/controls/menu/view_menu_delegate.h" | 22 #include "views/controls/menu/view_menu_delegate.h" |
| 23 #include "views/view.h" | 23 #include "views/view.h" |
| 24 | 24 |
| 25 class BrowserActionsContainer; | 25 class BrowserActionsContainer; |
| 26 class Browser; | 26 class Browser; |
| 27 class Profile; | 27 class Profile; |
| 28 class WrenchMenu; | 28 class WrenchMenu; |
| 29 | 29 |
| 30 namespace views { | |
| 31 class Menu2; | |
| 32 } | |
| 33 | |
| 34 // The Browser Window's toolbar. | 30 // The Browser Window's toolbar. |
| 35 class ToolbarView : public AccessibleToolbarView, | 31 class ToolbarView : public AccessibleToolbarView, |
| 36 public views::ViewMenuDelegate, | 32 public views::ViewMenuDelegate, |
| 37 public menus::SimpleMenuModel::Delegate, | 33 public menus::SimpleMenuModel::Delegate, |
| 38 public LocationBarView::Delegate, | 34 public LocationBarView::Delegate, |
| 39 public AnimationDelegate, | 35 public AnimationDelegate, |
| 40 public NotificationObserver, | 36 public NotificationObserver, |
| 41 public CommandUpdater::CommandObserver, | 37 public CommandUpdater::CommandObserver, |
| 42 public views::ButtonListener { | 38 public views::ButtonListener { |
| 43 public: | 39 public: |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 virtual views::View* GetDefaultFocusableChild(); | 124 virtual views::View* GetDefaultFocusableChild(); |
| 129 virtual void RemoveToolbarFocus(); | 125 virtual void RemoveToolbarFocus(); |
| 130 | 126 |
| 131 private: | 127 private: |
| 132 // Returns the number of pixels above the location bar in non-normal display. | 128 // Returns the number of pixels above the location bar in non-normal display. |
| 133 int PopupTopSpacing() const; | 129 int PopupTopSpacing() const; |
| 134 | 130 |
| 135 // Loads the images for all the child views. | 131 // Loads the images for all the child views. |
| 136 void LoadImages(); | 132 void LoadImages(); |
| 137 | 133 |
| 138 // Check if the menu exited with a code indicating the user wants to | |
| 139 // switch to the other menu, and then switch to that other menu. | |
| 140 void SwitchToOtherMenuIfNeeded(views::Menu2* previous_menu, | |
| 141 views::MenuButton* next_menu_button); | |
| 142 | |
| 143 void ActivateMenuButton(views::MenuButton* menu_button); | |
| 144 | |
| 145 // Types of display mode this toolbar can have. | 134 // Types of display mode this toolbar can have. |
| 146 enum DisplayMode { | 135 enum DisplayMode { |
| 147 DISPLAYMODE_NORMAL, // Normal toolbar with buttons, etc. | 136 DISPLAYMODE_NORMAL, // Normal toolbar with buttons, etc. |
| 148 DISPLAYMODE_LOCATION // Slimline toolbar showing only compact location | 137 DISPLAYMODE_LOCATION // Slimline toolbar showing only compact location |
| 149 // bar, used for popups. | 138 // bar, used for popups. |
| 150 }; | 139 }; |
| 151 bool IsDisplayModeNormal() const { | 140 bool IsDisplayModeNormal() const { |
| 152 return display_mode_ == DISPLAYMODE_NORMAL; | 141 return display_mode_ == DISPLAYMODE_NORMAL; |
| 153 } | 142 } |
| 154 | 143 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // running. | 204 // running. |
| 216 bool* destroyed_flag_; | 205 bool* destroyed_flag_; |
| 217 | 206 |
| 218 // When collapsed, the toolbar is just a tiny strip, no controls are visible. | 207 // When collapsed, the toolbar is just a tiny strip, no controls are visible. |
| 219 bool collapsed_; | 208 bool collapsed_; |
| 220 | 209 |
| 221 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); | 210 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); |
| 222 }; | 211 }; |
| 223 | 212 |
| 224 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ | 213 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ |
| OLD | NEW |