Chromium Code Reviews| Index: chrome/browser/ui/toolbar/toolbar_actions_bar.h |
| diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.h b/chrome/browser/ui/toolbar/toolbar_actions_bar.h |
| index 838699e24ba59e98db85a5b9c442c20596776d48..700dd1e3035b4f87144ca8d68c69d8f108a104a0 100644 |
| --- a/chrome/browser/ui/toolbar/toolbar_actions_bar.h |
| +++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.h |
| @@ -5,6 +5,7 @@ |
| #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ |
| #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ |
| +#include "base/callback.h" |
| #include "base/macros.h" |
| #include "base/memory/scoped_vector.h" |
| #include "base/memory/weak_ptr.h" |
| @@ -97,6 +98,9 @@ class ToolbarActionsBar : public extensions::ExtensionToolbarModel::Observer { |
| // Returns the number of icons that should be displayed. |
| size_t GetIconCount() const; |
| + // Returns the actions in the proper order. |
| + std::vector<ToolbarActionViewController*> GetActions() const; |
| + |
| // Creates the toolbar actions. |
| void CreateActions(); |
| @@ -122,6 +126,18 @@ class ToolbarActionsBar : public extensions::ExtensionToolbarModel::Observer { |
| int dropped_index, |
| DragType drag_type); |
| + // Notifies the ToolbarActionsBar that the delegate finished animating. |
| + void OnAnimationEnded(); |
| + |
| + // Returns true if the given |action| is visible. |
| + bool IsActionVisible(const ToolbarActionViewController* action) const; |
| + |
| + // Pops out a given |action|, ensuring it is visible. |
| + // |closure| will be called once any animation is complete. |
| + void PopOutAction(ToolbarActionViewController* action, |
| + const base::Closure& closure); |
| + void PopInAction(); |
|
Finnur
2015/04/27 14:39:00
nit: In context (next to PopOut) this naming makes
Devlin
2015/04/28 00:35:56
I like UndoPopOut, done.
|
| + |
| // Sets the active popup owner to be |popup_owner|. |
| void SetPopupOwner(ToolbarActionViewController* popup_owner); |
| @@ -132,7 +148,10 @@ class ToolbarActionsBar : public extensions::ExtensionToolbarModel::Observer { |
| ToolbarActionViewController* GetMainControllerForAction( |
| ToolbarActionViewController* action); |
| - const std::vector<ToolbarActionViewController*>& toolbar_actions() const { |
| + // Returns the underlying toolbar actions, but does not order them. Primarily |
| + // for use in testing. |
| + const std::vector<ToolbarActionViewController*>& toolbar_actions_unordered() |
| + const { |
| return toolbar_actions_.get(); |
| } |
| bool enabled() const { return model_ != nullptr; } |
| @@ -145,6 +164,9 @@ class ToolbarActionsBar : public extensions::ExtensionToolbarModel::Observer { |
| return platform_settings_; |
| } |
| ToolbarActionViewController* popup_owner() { return popup_owner_; } |
| + ToolbarActionViewController* popped_out_action() { |
| + return popped_out_action_; |
| + } |
| bool in_overflow_mode() const { return main_bar_ != nullptr; } |
| ToolbarActionsBarDelegate* delegate_for_test() { return delegate_; } |
| @@ -250,6 +272,9 @@ class ToolbarActionsBar : public extensions::ExtensionToolbarModel::Observer { |
| // be displayed, and, if there is, shown that bubble. |
| bool checked_extension_bubble_; |
| + ToolbarActionViewController* popped_out_action_; |
| + base::Closure popped_out_closure_; |
|
Finnur
2015/04/27 14:39:00
nit: Document.
Devlin
2015/04/28 00:35:56
Done.
|
| + |
| base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); |