| 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 "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // Returns the main (i.e., not overflow) controller for the given action. | 206 // Returns the main (i.e., not overflow) controller for the given action. |
| 207 ToolbarActionViewController* GetMainControllerForAction( | 207 ToolbarActionViewController* GetMainControllerForAction( |
| 208 ToolbarActionViewController* action); | 208 ToolbarActionViewController* action); |
| 209 | 209 |
| 210 // Add or remove an observer. | 210 // Add or remove an observer. |
| 211 void AddObserver(ToolbarActionsBarObserver* observer); | 211 void AddObserver(ToolbarActionsBarObserver* observer); |
| 212 void RemoveObserver(ToolbarActionsBarObserver* observer); | 212 void RemoveObserver(ToolbarActionsBarObserver* observer); |
| 213 | 213 |
| 214 // Displays the given |bubble| once the toolbar is no longer animating. | 214 // Displays the given |bubble| once the toolbar is no longer animating. |
| 215 void ShowToolbarActionBubble( | 215 void ShowToolbarActionBubble( |
| 216 scoped_ptr<ToolbarActionsBarBubbleDelegate> bubble); | 216 std::unique_ptr<ToolbarActionsBarBubbleDelegate> bubble); |
| 217 | 217 |
| 218 // Returns the underlying toolbar actions, but does not order them. Primarily | 218 // Returns the underlying toolbar actions, but does not order them. Primarily |
| 219 // for use in testing. | 219 // for use in testing. |
| 220 const std::vector<ToolbarActionViewController*>& toolbar_actions_unordered() | 220 const std::vector<ToolbarActionViewController*>& toolbar_actions_unordered() |
| 221 const { | 221 const { |
| 222 return toolbar_actions_.get(); | 222 return toolbar_actions_.get(); |
| 223 } | 223 } |
| 224 bool enabled() const { return model_ != nullptr; } | 224 bool enabled() const { return model_ != nullptr; } |
| 225 bool suppress_layout() const { return suppress_layout_; } | 225 bool suppress_layout() const { return suppress_layout_; } |
| 226 bool suppress_animation() const { | 226 bool suppress_animation() const { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 // Returns the current web contents. | 270 // Returns the current web contents. |
| 271 content::WebContents* GetCurrentWebContents(); | 271 content::WebContents* GetCurrentWebContents(); |
| 272 | 272 |
| 273 // Reorders the toolbar actions to reflect the model and, optionally, to | 273 // Reorders the toolbar actions to reflect the model and, optionally, to |
| 274 // "pop out" any overflowed actions that want to run (depending on the | 274 // "pop out" any overflowed actions that want to run (depending on the |
| 275 // value of |pop_out_actions_to_run|. | 275 // value of |pop_out_actions_to_run|. |
| 276 void ReorderActions(); | 276 void ReorderActions(); |
| 277 | 277 |
| 278 // Shows an extension message bubble, if any should be shown. | 278 // Shows an extension message bubble, if any should be shown. |
| 279 void MaybeShowExtensionBubble( | 279 void MaybeShowExtensionBubble( |
| 280 scoped_ptr<extensions::ExtensionMessageBubbleController> controller); | 280 std::unique_ptr<extensions::ExtensionMessageBubbleController> controller); |
| 281 | 281 |
| 282 // The delegate for this object (in a real build, this is the view). | 282 // The delegate for this object (in a real build, this is the view). |
| 283 ToolbarActionsBarDelegate* delegate_; | 283 ToolbarActionsBarDelegate* delegate_; |
| 284 | 284 |
| 285 // The associated browser. | 285 // The associated browser. |
| 286 Browser* browser_; | 286 Browser* browser_; |
| 287 | 287 |
| 288 // The observed toolbar model. | 288 // The observed toolbar model. |
| 289 ToolbarActionsModel* model_; | 289 ToolbarActionsModel* model_; |
| 290 | 290 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // out even if another menu is opened. | 333 // out even if another menu is opened. |
| 334 bool is_popped_out_sticky_; | 334 bool is_popped_out_sticky_; |
| 335 | 335 |
| 336 // The task to alert the |popped_out_action_| that animation has finished, and | 336 // The task to alert the |popped_out_action_| that animation has finished, and |
| 337 // it is fully popped out. | 337 // it is fully popped out. |
| 338 base::Closure popped_out_closure_; | 338 base::Closure popped_out_closure_; |
| 339 | 339 |
| 340 // The controller of the extension message bubble to show once animation | 340 // The controller of the extension message bubble to show once animation |
| 341 // finishes, if any. This has priority over | 341 // finishes, if any. This has priority over |
| 342 // |pending_toolbar_bubble_controller_|. | 342 // |pending_toolbar_bubble_controller_|. |
| 343 scoped_ptr<extensions::ExtensionMessageBubbleController> | 343 std::unique_ptr<extensions::ExtensionMessageBubbleController> |
| 344 pending_extension_bubble_controller_; | 344 pending_extension_bubble_controller_; |
| 345 | 345 |
| 346 // The controller for the toolbar action bubble to show once animation | 346 // The controller for the toolbar action bubble to show once animation |
| 347 // finishes, if any. | 347 // finishes, if any. |
| 348 scoped_ptr<ToolbarActionsBarBubbleDelegate> | 348 std::unique_ptr<ToolbarActionsBarBubbleDelegate> |
| 349 pending_toolbar_bubble_controller_; | 349 pending_toolbar_bubble_controller_; |
| 350 | 350 |
| 351 base::ObserverList<ToolbarActionsBarObserver> observers_; | 351 base::ObserverList<ToolbarActionsBarObserver> observers_; |
| 352 | 352 |
| 353 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; | 353 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; |
| 354 | 354 |
| 355 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); | 355 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ | 358 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ |
| OLD | NEW |