| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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 "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/browser/bubble_positioner.h" |
| 12 #include "chrome/browser/command_updater.h" | 13 #include "chrome/browser/command_updater.h" |
| 13 #include "chrome/browser/user_data_manager.h" | 14 #include "chrome/browser/user_data_manager.h" |
| 14 #include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h" | |
| 15 #include "chrome/browser/views/go_button.h" | 15 #include "chrome/browser/views/go_button.h" |
| 16 #include "chrome/browser/views/location_bar_view.h" | 16 #include "chrome/browser/views/location_bar_view.h" |
| 17 #include "chrome/common/pref_member.h" | 17 #include "chrome/common/pref_member.h" |
| 18 #include "views/controls/button/menu_button.h" | 18 #include "views/controls/button/menu_button.h" |
| 19 #include "views/controls/menu/menu.h" | 19 #include "views/controls/menu/menu.h" |
| 20 #include "views/controls/menu/simple_menu_model.h" | 20 #include "views/controls/menu/simple_menu_model.h" |
| 21 #include "views/controls/menu/view_menu_delegate.h" | 21 #include "views/controls/menu/view_menu_delegate.h" |
| 22 #include "views/view.h" | 22 #include "views/view.h" |
| 23 | 23 |
| 24 class BackForwardMenuModelViews; | 24 class BackForwardMenuModelViews; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // The Browser Window's toolbar. Used within BrowserView. | 65 // The Browser Window's toolbar. Used within BrowserView. |
| 66 class ToolbarView : public views::View, | 66 class ToolbarView : public views::View, |
| 67 public views::ViewMenuDelegate, | 67 public views::ViewMenuDelegate, |
| 68 public views::DragController, | 68 public views::DragController, |
| 69 public views::SimpleMenuModel::Delegate, | 69 public views::SimpleMenuModel::Delegate, |
| 70 public LocationBarView::Delegate, | 70 public LocationBarView::Delegate, |
| 71 public NotificationObserver, | 71 public NotificationObserver, |
| 72 public GetProfilesHelper::Delegate, | 72 public GetProfilesHelper::Delegate, |
| 73 public CommandUpdater::CommandObserver, | 73 public CommandUpdater::CommandObserver, |
| 74 public views::ButtonListener, | 74 public views::ButtonListener, |
| 75 public AutocompletePopupPositioner { | 75 public BubblePositioner { |
| 76 public: | 76 public: |
| 77 explicit ToolbarView(Browser* browser); | 77 explicit ToolbarView(Browser* browser); |
| 78 virtual ~ToolbarView(); | 78 virtual ~ToolbarView(); |
| 79 | 79 |
| 80 // Create the contents of the Browser Toolbar | 80 // Create the contents of the Browser Toolbar |
| 81 void Init(Profile* profile); | 81 void Init(Profile* profile); |
| 82 | 82 |
| 83 // Sets the profile which is active on the currently-active tab. | 83 // Sets the profile which is active on the currently-active tab. |
| 84 void SetProfile(Profile* profile); | 84 void SetProfile(Profile* profile); |
| 85 Profile* profile() { return profile_; } | 85 Profile* profile() { return profile_; } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // Overridden from LocationBarView::Delegate: | 121 // Overridden from LocationBarView::Delegate: |
| 122 virtual TabContents* GetTabContents(); | 122 virtual TabContents* GetTabContents(); |
| 123 virtual void OnInputInProgress(bool in_progress); | 123 virtual void OnInputInProgress(bool in_progress); |
| 124 | 124 |
| 125 // Overridden from CommandUpdater::CommandObserver: | 125 // Overridden from CommandUpdater::CommandObserver: |
| 126 virtual void EnabledStateChangedForCommand(int id, bool enabled); | 126 virtual void EnabledStateChangedForCommand(int id, bool enabled); |
| 127 | 127 |
| 128 // Overridden from views::BaseButton::ButtonListener: | 128 // Overridden from views::BaseButton::ButtonListener: |
| 129 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 129 virtual void ButtonPressed(views::Button* sender, const views::Event& event); |
| 130 | 130 |
| 131 // Overridden from AutocompletePopupPositioner: | 131 // BubblePositioner: |
| 132 virtual gfx::Rect GetPopupBounds() const; | 132 virtual gfx::Rect GetLocationStackBounds() const; |
| 133 | 133 |
| 134 // Overridden from NotificationObserver: | 134 // Overridden from NotificationObserver: |
| 135 virtual void Observe(NotificationType type, | 135 virtual void Observe(NotificationType type, |
| 136 const NotificationSource& source, | 136 const NotificationSource& source, |
| 137 const NotificationDetails& details); | 137 const NotificationDetails& details); |
| 138 | 138 |
| 139 // Overridden from views::SimpleMenuModel::Delegate: | 139 // Overridden from views::SimpleMenuModel::Delegate: |
| 140 virtual bool IsCommandIdChecked(int command_id) const; | 140 virtual bool IsCommandIdChecked(int command_id) const; |
| 141 virtual bool IsCommandIdEnabled(int command_id) const; | 141 virtual bool IsCommandIdEnabled(int command_id) const; |
| 142 virtual bool GetAcceleratorForCommandId(int command_id, | 142 virtual bool GetAcceleratorForCommandId(int command_id, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 scoped_ptr<EncodingMenuModel> encoding_menu_contents_; | 244 scoped_ptr<EncodingMenuModel> encoding_menu_contents_; |
| 245 scoped_ptr<views::SimpleMenuModel> devtools_menu_contents_; | 245 scoped_ptr<views::SimpleMenuModel> devtools_menu_contents_; |
| 246 scoped_ptr<views::SimpleMenuModel> app_menu_contents_; | 246 scoped_ptr<views::SimpleMenuModel> app_menu_contents_; |
| 247 | 247 |
| 248 // TODO(beng): build these into MenuButton. | 248 // TODO(beng): build these into MenuButton. |
| 249 scoped_ptr<views::Menu2> page_menu_menu_; | 249 scoped_ptr<views::Menu2> page_menu_menu_; |
| 250 scoped_ptr<views::Menu2> app_menu_menu_; | 250 scoped_ptr<views::Menu2> app_menu_menu_; |
| 251 }; | 251 }; |
| 252 | 252 |
| 253 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ | 253 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ |
| OLD | NEW |