| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Sets the profile which is active on the currently-active tab. | 73 // Sets the profile which is active on the currently-active tab. |
| 74 void SetProfile(Profile* profile); | 74 void SetProfile(Profile* profile); |
| 75 Profile* profile() { return profile_; } | 75 Profile* profile() { return profile_; } |
| 76 | 76 |
| 77 ToolbarStarToggle* star_button() { return star_; } | 77 ToolbarStarToggle* star_button() { return star_; } |
| 78 | 78 |
| 79 GoButton* GetGoButton() { return go_; } | 79 GoButton* GetGoButton() { return go_; } |
| 80 | 80 |
| 81 LocationBarView* GetLocationBarView() const { return location_bar_; } | 81 LocationBarView* GetLocationBarView() const { return location_bar_; } |
| 82 | 82 |
| 83 bool IsDisplayModeNormal() const { |
| 84 return display_mode_ == DISPLAYMODE_NORMAL; |
| 85 } |
| 86 |
| 83 // Updates the toolbar (and transitively the location bar) with the states of | 87 // Updates the toolbar (and transitively the location bar) with the states of |
| 84 // the specified |tab|. If |should_restore_state| is true, we're switching | 88 // the specified |tab|. If |should_restore_state| is true, we're switching |
| 85 // (back?) to this tab and should restore any previous location bar state | 89 // (back?) to this tab and should restore any previous location bar state |
| 86 // (such as user editing) as well. | 90 // (such as user editing) as well. |
| 87 void Update(TabContents* tab, bool should_restore_state); | 91 void Update(TabContents* tab, bool should_restore_state); |
| 88 | 92 |
| 89 void OnInputInProgress(bool in_progress); | 93 void OnInputInProgress(bool in_progress); |
| 90 | 94 |
| 91 // Returns the MSAA role of the current view. The role is what assistive | 95 // Returns the MSAA role of the current view. The role is what assistive |
| 92 // technologies (ATs) use to determine what behavior to expect from a given | 96 // technologies (ATs) use to determine what behavior to expect from a given |
| (...skipping 25 matching lines...) Expand all Loading... |
| 118 | 122 |
| 119 Browser* browser() { return browser_; } | 123 Browser* browser() { return browser_; } |
| 120 | 124 |
| 121 // Overridden from CommandUpdater::CommandObserver: | 125 // Overridden from CommandUpdater::CommandObserver: |
| 122 virtual void EnabledStateChangedForCommand(int id, bool enabled); | 126 virtual void EnabledStateChangedForCommand(int id, bool enabled); |
| 123 | 127 |
| 124 // Overridden from views::BaseButton::ButtonListener: | 128 // Overridden from views::BaseButton::ButtonListener: |
| 125 virtual void ButtonPressed(views::BaseButton* sender); | 129 virtual void ButtonPressed(views::BaseButton* sender); |
| 126 | 130 |
| 127 private: | 131 private: |
| 132 // Types of display mode this toolbar can have. |
| 133 enum DisplayMode { |
| 134 DISPLAYMODE_NORMAL, |
| 135 DISPLAYMODE_LOCATION |
| 136 }; |
| 137 |
| 128 // NotificationObserver | 138 // NotificationObserver |
| 129 virtual void Observe(NotificationType type, | 139 virtual void Observe(NotificationType type, |
| 130 const NotificationSource& source, | 140 const NotificationSource& source, |
| 131 const NotificationDetails& details); | 141 const NotificationDetails& details); |
| 132 | 142 |
| 133 // DragController methods for the star button. These allow the drag if the | 143 // DragController methods for the star button. These allow the drag if the |
| 134 // user hasn't edited the text, the url is valid and should be displayed. | 144 // user hasn't edited the text, the url is valid and should be displayed. |
| 135 virtual void WriteDragData(View* sender, | 145 virtual void WriteDragData(View* sender, |
| 136 int press_x, | 146 int press_x, |
| 137 int press_y, | 147 int press_y, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 151 void RunPageMenu(const CPoint& pt, HWND hwnd); | 161 void RunPageMenu(const CPoint& pt, HWND hwnd); |
| 152 | 162 |
| 153 // Show the app menu. | 163 // Show the app menu. |
| 154 void RunAppMenu(const CPoint& pt, HWND hwnd); | 164 void RunAppMenu(const CPoint& pt, HWND hwnd); |
| 155 | 165 |
| 156 // Overridden from View, to pass keyboard triggering of the right-click | 166 // Overridden from View, to pass keyboard triggering of the right-click |
| 157 // context menu on to the toolbar child view that currently has the | 167 // context menu on to the toolbar child view that currently has the |
| 158 // accessibility focus. | 168 // accessibility focus. |
| 159 virtual void ShowContextMenu(int x, int y, bool is_mouse_gesture); | 169 virtual void ShowContextMenu(int x, int y, bool is_mouse_gesture); |
| 160 | 170 |
| 161 // Types of display mode this toolbar can have. | |
| 162 enum DisplayMode { | |
| 163 DISPLAYMODE_NORMAL, | |
| 164 DISPLAYMODE_LOCATION | |
| 165 }; | |
| 166 bool IsDisplayModeNormal() const { | |
| 167 return display_mode_ == DISPLAYMODE_NORMAL; | |
| 168 } | |
| 169 | |
| 170 scoped_ptr<BackForwardMenuModel> back_menu_model_; | 171 scoped_ptr<BackForwardMenuModel> back_menu_model_; |
| 171 scoped_ptr<BackForwardMenuModel> forward_menu_model_; | 172 scoped_ptr<BackForwardMenuModel> forward_menu_model_; |
| 172 | 173 |
| 173 // The model that contains the security level, text, icon to display... | 174 // The model that contains the security level, text, icon to display... |
| 174 ToolbarModel* model_; | 175 ToolbarModel* model_; |
| 175 | 176 |
| 176 // Storage of strings needed for accessibility. | 177 // Storage of strings needed for accessibility. |
| 177 std::wstring accessible_name_; | 178 std::wstring accessible_name_; |
| 178 // Child view currently having MSAA focus (location bar excluded from arrow | 179 // Child view currently having MSAA focus (location bar excluded from arrow |
| 179 // navigation). | 180 // navigation). |
| (...skipping 22 matching lines...) Expand all Loading... |
| 202 scoped_refptr<GetProfilesHelper> profiles_helper_; | 203 scoped_refptr<GetProfilesHelper> profiles_helper_; |
| 203 | 204 |
| 204 // Controls whether or not a home button should be shown on the toolbar. | 205 // Controls whether or not a home button should be shown on the toolbar. |
| 205 BooleanPrefMember show_home_button_; | 206 BooleanPrefMember show_home_button_; |
| 206 | 207 |
| 207 // The display mode used when laying out the toolbar. | 208 // The display mode used when laying out the toolbar. |
| 208 DisplayMode display_mode_; | 209 DisplayMode display_mode_; |
| 209 }; | 210 }; |
| 210 | 211 |
| 211 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H__ | 212 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H__ |
| OLD | NEW |