Infobar material design refresh: layout
[chromium-blink-merge.git] / chrome / browser / ui / toolbar / toolbar_actions_bar_delegate.h
blobd7c6df299c8d37f0f7e9e3c71ebdbca89124f3c6
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
19 // ToolbarActionsBar.
20 class ToolbarActionsBarDelegate {
21 public:
22 virtual ~ToolbarActionsBarDelegate() {}
24 // Adds a view for the given |action| at |index|.
25 virtual void AddViewForAction(ToolbarActionViewController* action,
26 size_t index) = 0;
28 // Removes the view for the given |action|.
29 virtual void RemoveViewForAction(ToolbarActionViewController* action) = 0;
31 // Removes all action views.
32 virtual void RemoveAllViews() = 0;
34 // Redraws the view for the toolbar actions bar. |order_changed| indicates
35 // whether or not the change caused a reordering of the actions.
36 virtual void Redraw(bool order_changed) = 0;
38 // Resizes the view to the |target_width| and animates with the given
39 // |tween_type|. |suppress_chevron| indicates if the chevron should not be
40 // shown during the animation.
41 virtual void ResizeAndAnimate(gfx::Tween::Type tween_type,
42 int target_width,
43 bool suppress_chevron) = 0;
45 // Sets the overflow chevron's visibility.
46 virtual void SetChevronVisibility(bool chevron_visible) = 0;
48 // Returns the current width of the view.
49 virtual int GetWidth() const = 0;
51 // Returns true if the view is animating.
52 virtual bool IsAnimating() const = 0;
54 // Stops the current animation (width remains where it currently is).
55 virtual void StopAnimating() = 0;
57 // Returns the width (including padding) for the overflow chevron.
58 virtual int GetChevronWidth() const = 0;
60 // Notifies the delegate that the value of whether or not any overflowed
61 // action wants to run has changed.
62 virtual void OnOverflowedActionWantsToRunChanged(
63 bool overflowed_action_wants_to_run) = 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_