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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_DELEGATE_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_DELEGATE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/animation/tween.h"
10 #include "ui/gfx/geometry/size.h"
12 class ToolbarActionViewController
;
14 namespace extensions
{
15 class ExtensionMessageBubbleController
;
18 // The delegate class (which, in production, represents the view) of the
20 class ToolbarActionsBarDelegate
{
23 GET_WIDTH_CURRENT
, // Returns the current width.
24 GET_WIDTH_AFTER_ANIMATION
, // Returns the width after a running animation.
27 virtual ~ToolbarActionsBarDelegate() {}
29 // Adds a view for the given |action| at |index|.
30 virtual void AddViewForAction(ToolbarActionViewController
* action
,
33 // Removes the view for the given |action|.
34 virtual void RemoveViewForAction(ToolbarActionViewController
* action
) = 0;
36 // Removes all action views.
37 virtual void RemoveAllViews() = 0;
39 // Redraws the view for the toolbar actions bar. |order_changed| indicates
40 // whether or not the change caused a reordering of the actions.
41 virtual void Redraw(bool order_changed
) = 0;
43 // Resizes the view to the |target_width| and animates with the given
44 // |tween_type|. |suppress_chevron| indicates if the chevron should not be
45 // shown during the animation.
46 virtual void ResizeAndAnimate(gfx::Tween::Type tween_type
,
48 bool suppress_chevron
) = 0;
50 // Sets the overflow chevron's visibility.
51 virtual void SetChevronVisibility(bool chevron_visible
) = 0;
53 // Returns the width of the view according to |get_width_time|.
54 virtual int GetWidth(GetWidthTime get_width_time
) const = 0;
56 // Returns true if the view is animating.
57 virtual bool IsAnimating() const = 0;
59 // Stops the current animation (width remains where it currently is).
60 virtual void StopAnimating() = 0;
62 // Returns the width (including padding) for the overflow chevron.
63 virtual int GetChevronWidth() const = 0;
65 // Displays the bubble for the passed ExtensionMessageBubbleController,
66 // anchored to |anchor_action|. If |anchor_action| is null, it should be
67 // anchored to the hotdog menu.
68 virtual void ShowExtensionMessageBubble(
69 scoped_ptr
<extensions::ExtensionMessageBubbleController
> controller
,
70 ToolbarActionViewController
* anchor_action
) = 0;
73 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_DELEGATE_H_