Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 | 189 |
| 190 // Pops out a given |action|, ensuring it is visible. | 190 // Pops out a given |action|, ensuring it is visible. |
| 191 // |is_sticky| refers to whether or not the action will stay popped out if | 191 // |is_sticky| refers to whether or not the action will stay popped out if |
| 192 // the overflow menu is opened. | 192 // the overflow menu is opened. |
| 193 // |closure| will be called once any animation is complete. | 193 // |closure| will be called once any animation is complete. |
| 194 void PopOutAction(ToolbarActionViewController* action, | 194 void PopOutAction(ToolbarActionViewController* action, |
| 195 bool is_sticky, | 195 bool is_sticky, |
| 196 const base::Closure& closure); | 196 const base::Closure& closure); |
| 197 | 197 |
| 198 // Undoes the current "pop out"; i.e., moves the popped out action back into | 198 // Undoes the current "pop out"; i.e., moves the popped out action back into |
| 199 // overflow. | 199 // overflow. Marked virtual for tests. |
| 200 void UndoPopOut(); | 200 virtual void UndoPopOut(); |
|
Devlin
2016/12/15 22:25:26
I'd like to avoid this if possible; see also comme
| |
| 201 | 201 |
| 202 // Sets the active popup owner to be |popup_owner|. | 202 // Sets the active popup owner to be |popup_owner|. |
| 203 void SetPopupOwner(ToolbarActionViewController* popup_owner); | 203 void SetPopupOwner(ToolbarActionViewController* popup_owner); |
| 204 | 204 |
| 205 // Hides the actively showing popup, if any. | 205 // Hides the actively showing popup, if any. |
| 206 void HideActivePopup(); | 206 void HideActivePopup(); |
| 207 | 207 |
| 208 // Returns the main (i.e., not overflow) controller for the given action. | 208 // Returns the main (i.e., not overflow) controller for the given action. |
| 209 ToolbarActionViewController* GetMainControllerForAction( | 209 ToolbarActionViewController* GetMainControllerForAction( |
| 210 ToolbarActionViewController* action); | 210 ToolbarActionViewController* action); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 233 } | 233 } |
| 234 bool is_highlighting() const { return model_ && model_->is_highlighting(); } | 234 bool is_highlighting() const { return model_ && model_->is_highlighting(); } |
| 235 ToolbarActionsModel::HighlightType highlight_type() const { | 235 ToolbarActionsModel::HighlightType highlight_type() const { |
| 236 return model_ ? model_->highlight_type() | 236 return model_ ? model_->highlight_type() |
| 237 : ToolbarActionsModel::HIGHLIGHT_NONE; | 237 : ToolbarActionsModel::HIGHLIGHT_NONE; |
| 238 } | 238 } |
| 239 const PlatformSettings& platform_settings() const { | 239 const PlatformSettings& platform_settings() const { |
| 240 return platform_settings_; | 240 return platform_settings_; |
| 241 } | 241 } |
| 242 ToolbarActionViewController* popup_owner() { return popup_owner_; } | 242 ToolbarActionViewController* popup_owner() { return popup_owner_; } |
| 243 ToolbarActionViewController* popped_out_action() { | 243 // Marked virtual for tests. |
| 244 return popped_out_action_; | 244 virtual ToolbarActionViewController* popped_out_action(); |
| 245 } | |
| 246 bool in_overflow_mode() const { return main_bar_ != nullptr; } | 245 bool in_overflow_mode() const { return main_bar_ != nullptr; } |
| 247 bool is_showing_bubble() const { return is_showing_bubble_; } | 246 bool is_showing_bubble() const { return is_showing_bubble_; } |
| 248 | 247 |
| 249 ToolbarActionsBarDelegate* delegate_for_test() { return delegate_; } | 248 ToolbarActionsBarDelegate* delegate_for_test() { return delegate_; } |
| 250 | 249 |
| 251 // During testing we can disable animations by setting this flag to true, | 250 // During testing we can disable animations by setting this flag to true, |
| 252 // so that the bar resizes instantly, instead of having to poll it while it | 251 // so that the bar resizes instantly, instead of having to poll it while it |
| 253 // animates to open/closed status. | 252 // animates to open/closed status. |
| 254 static bool disable_animations_for_testing_; | 253 static bool disable_animations_for_testing_; |
| 255 static void set_extension_bubble_appearance_wait_time_for_testing( | 254 static void set_extension_bubble_appearance_wait_time_for_testing( |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 ScopedObserver<TabStripModel, TabStripModelObserver> tab_strip_observer_; | 360 ScopedObserver<TabStripModel, TabStripModelObserver> tab_strip_observer_; |
| 362 | 361 |
| 363 base::ObserverList<ToolbarActionsBarObserver> observers_; | 362 base::ObserverList<ToolbarActionsBarObserver> observers_; |
| 364 | 363 |
| 365 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; | 364 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; |
| 366 | 365 |
| 367 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); | 366 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); |
| 368 }; | 367 }; |
| 369 | 368 |
| 370 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ | 369 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ |
| OLD | NEW |