browser_actions_container.h revision effb81e5f8246d0db0270817048dc992db66e9fb
115efc4d597a47e6ba5794d4fd8d561bf6947233cRichard Smith// Copyright 2013 The Chromium Authors. All rights reserved.
2c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// Use of this source code is governed by a BSD-style license that can be
3c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// found in the LICENSE file.
4c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
5c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTIONS_CONTAINER_H_
6c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTIONS_CONTAINER_H_
7c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
8c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "base/observer_list.h"
9c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "chrome/browser/extensions/extension_keybinding_registry.h"
10c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "chrome/browser/extensions/extension_toolbar_model.h"
11c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "chrome/browser/ui/views/chrome_views_export.h"
12c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.h"
13c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views.h"
14c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "chrome/browser/ui/views/extensions/extension_popup.h"
15c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "chrome/browser/ui/views/toolbar/browser_action_view.h"
16c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "chrome/browser/ui/views/toolbar/browser_actions_container_observer.h"
17c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "content/public/browser/notification_observer.h"
18c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "ui/gfx/animation/animation_delegate.h"
19c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "ui/gfx/animation/tween.h"
20c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "ui/views/controls/button/menu_button.h"
21c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "ui/views/controls/button/menu_button_listener.h"
22c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "ui/views/controls/resize_area_delegate.h"
23c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "ui/views/drag_controller.h"
24c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "ui/views/view.h"
25c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#include "ui/views/widget/widget_observer.h"
26c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
27c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithclass BrowserActionButton;
28c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithclass ExtensionKeybindingRegistryViews;
29c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithclass ExtensionPopup;
30c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
31c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithnamespace extensions {
32c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithclass ActiveTabPermissionGranter;
33c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithclass Command;
34c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithclass Extension;
35c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith}
3651201882382fb40c9456a06c7f93d6ddd4a57712Richard Smith
37c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithnamespace gfx {
38c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithclass SlideAnimation;
39c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith}
4051201882382fb40c9456a06c7f93d6ddd4a57712Richard Smith
41c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithnamespace views {
42c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithclass ResizeArea;
43c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith}
44c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
45c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith////////////////////////////////////////////////////////////////////////////////
46c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
47c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// The BrowserActionsContainer is a container view, responsible for drawing the
48c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// browser action icons (extensions that add icons to the toolbar).
49c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
50c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// The container is placed flush against the omnibox and wrench menu, and its
51c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// layout looks like:
52c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//   rI_I_IcCs
53c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// Where the letters are as follows:
54c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//   r: An invisible resize area.  This is ToolbarView::kStandardSpacing pixels
55c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//      wide and directly adjacent to the omnibox.
56c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//   I: An icon.  This is as wide as the IDR_BROWSER_ACTION image.
57c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//   _: kItemSpacing pixels of empty space.
58c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//   c: kChevronSpacing pixels of empty space.  Only present if C is present.
5908d6e032a2a0a8656d12b3b7b93942987bb12eb7Richard Smith//   C: An optional chevron, visible for overflow.  As wide as the
60c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//      IDR_BROWSER_ACTIONS_OVERFLOW image.
61c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//   s: ToolbarView::kStandardSpacing pixels of empty space (before the wrench
62c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//      menu).
63c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// The reason the container contains the trailing space "s", rather than having
64c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// it be handled by the parent view, is so that when the chevron is invisible
65c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// and the user starts dragging an icon around, we have the space to draw the
66c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// ultimate drop indicator.  (Otherwise, we'd be trying to draw it into the
6708d6e032a2a0a8656d12b3b7b93942987bb12eb7Richard Smith// padding beyond our right edge, and it wouldn't appear.)
68c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
69c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// The BrowserActionsContainer follows a few rules, in terms of user experience:
7008d6e032a2a0a8656d12b3b7b93942987bb12eb7Richard Smith//
71c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// 1) The container can never grow beyond the space needed to show all icons
72c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// (hereby referred to as the max width).
73c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// 2) The container can never shrink below the space needed to show just the
74c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// initial padding and the chevron (ignoring the case where there are no icons
75c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// to show, in which case the container won't be visible anyway).
76c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// 3) The container snaps into place (to the pixel count that fits the visible
77c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// icons) to make sure there is no wasted space at the edges of the container.
78c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// 4) If the user adds or removes icons (read: installs/uninstalls browser
79c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// actions) we grow and shrink the container as needed - but ONLY if the
80c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// container was at max width to begin with.
81099e7f647ccda915513f2b2ec53352dc756082d3Richard Smith// 5) If the container is NOT at max width (has an overflow menu), we respect
82c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// that size when adding and removing icons and DON'T grow/shrink the container.
83c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// This means that new icons (which always appear at the far right) will show up
84c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// in the overflow menu. The install bubble for extensions points to the chevron
85c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// menu in this case.
86c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
87099e7f647ccda915513f2b2ec53352dc756082d3Richard Smith// Resizing the BrowserActionsContainer:
88c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
89c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// The ResizeArea view sends OnResize messages to the BrowserActionsContainer
9008d6e032a2a0a8656d12b3b7b93942987bb12eb7Richard Smith// class as the user drags it. This modifies the value for |resize_amount_|.
91c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// That indicates to the container that a resize is in progress and is used to
92c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// calculate the size in GetPreferredSize(), though that function never exceeds
93c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// the defined minimum and maximum size of the container.
94c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
95c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// When the user releases the mouse (ends the resize), we calculate a target
96c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// size for the container (animation_target_size_), clamp that value to the
97c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// containers min and max and then animate from the *current* position (that the
981e7fc3d31e17fbe314f86de96aac6e9a2f297167Richard Smith// user has dragged the view to) to the target size.
99c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
100c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// Animating the BrowserActionsContainer:
101c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
1021e7fc3d31e17fbe314f86de96aac6e9a2f297167Richard Smith// Animations are used when snapping the container to a value that fits all
103c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// visible icons. This can be triggered when the user finishes resizing the
104c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// container or when Browser Actions are added/removed.
105c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
106c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// We always animate from the current width (container_width_) to the target
10708d6e032a2a0a8656d12b3b7b93942987bb12eb7Richard Smith// size (animation_target_size_), using |resize_amount| to keep track of the
10808d6e032a2a0a8656d12b3b7b93942987bb12eb7Richard Smith// animation progress.
109c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
110c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// NOTE: When adding Browser Actions to a maximum width container (no overflow)
111c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// we make sure to suppress the chevron menu if it wasn't visible. This is
112c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// because we won't have enough space to show the new Browser Action until the
113c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// animation ends and we don't want the chevron to flash into view while we are
114c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith// growing the container.
115c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith//
116c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith////////////////////////////////////////////////////////////////////////////////
117c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smithclass BrowserActionsContainer
118c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith    : public views::View,
119c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith      public views::MenuButtonListener,
120395f1c08ff720be7df6535a86df14b6d36a2d57aRichard Smith      public views::ResizeAreaDelegate,
121395f1c08ff720be7df6535a86df14b6d36a2d57aRichard Smith      public gfx::AnimationDelegate,
122f72fccf533bca206af8e75d041c29db99e6a7f2cRichard Smith      public extensions::ExtensionToolbarModel::Observer,
123c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith      public BrowserActionOverflowMenuController::Observer,
1248ef7b203332b0c8d65876a1f5e6d1db4e6f40e4bRichard Smith      public views::WidgetObserver,
125c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith      public BrowserActionView::Delegate,
126c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith      public extensions::ExtensionKeybindingRegistry::Delegate {
127c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith public:
128c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  BrowserActionsContainer(Browser* browser, views::View* owner_view);
129c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  virtual ~BrowserActionsContainer();
130c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
131789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  void Init();
132789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith
133789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  // Get the number of browser actions being displayed.
134789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  int num_browser_actions() const { return browser_action_views_.size(); }
135789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith
1363df61308ddfbdba0897b762a129b5a38750c87d0Richard Smith  // Whether we are performing resize animation on the container.
137789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  bool animating() const { return animation_target_size_ > 0; }
138789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith
139789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  // Returns the chevron, if any.
140789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  views::View* chevron() { return chevron_; }
141789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  const views::View* chevron() const { return chevron_; }
142789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith
143789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  // Returns the profile this container is associated with.
144789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  Profile* profile() const { return profile_; }
145789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith
146789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  // Get a particular browser action view.
147925d8e7c0f18e03dc4bc634b3c6c1ec09373d993Richard Smith  BrowserActionView* GetBrowserActionViewAt(int index) {
148925d8e7c0f18e03dc4bc634b3c6c1ec09373d993Richard Smith    return browser_action_views_[index];
149925d8e7c0f18e03dc4bc634b3c6c1ec09373d993Richard Smith  }
150925d8e7c0f18e03dc4bc634b3c6c1ec09373d993Richard Smith
151925d8e7c0f18e03dc4bc634b3c6c1ec09373d993Richard Smith  // Retrieve the BrowserActionView for a certain extension |action|.
152789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  BrowserActionView* GetBrowserActionView(ExtensionAction* action);
153789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith
154789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  // Update the views to reflect the state of the browser action icons.
155789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  void RefreshBrowserActionViews();
156789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith
157789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  // Sets up the browser action view vector.
158789f9b6be5df6e5151ac35e68416cdf550db1196Richard Smith  void CreateBrowserActionViews();
159c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
160c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Delete all browser action views.
161c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  void DeleteBrowserActionViews();
162c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
163c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Returns how many browser actions are visible.
164c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  size_t VisibleBrowserActions() const;
165c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
166c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Executes |command| registered by |extension|.
16761e616206413d1779c7545c7a8ad1ce1129ad9c1Richard Smith  void ExecuteExtensionCommand(const extensions::Extension* extension,
168c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith                               const extensions::Command& command);
169244ee7b89a483fd3764637abdf95de2893b437d0Richard Smith
170c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Add or remove an observer.
171b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  void AddObserver(BrowserActionsContainerObserver* observer);
172b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  void RemoveObserver(BrowserActionsContainerObserver* observer);
173b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith
174b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  // Overridden from views::View:
175b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual gfx::Size GetPreferredSize() OVERRIDE;
176b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual void Layout() OVERRIDE;
177b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual bool GetDropFormats(int* formats,
178b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith      std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE;
179b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual bool AreDropTypesRequired() OVERRIDE;
180b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual bool CanDrop(const ui::OSExchangeData& data) OVERRIDE;
181b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE;
182b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE;
183b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual void OnDragExited() OVERRIDE;
184b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
185b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
186b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith
187b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  // Overridden from views::MenuButtonListener:
188b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual void OnMenuButtonClicked(views::View* source,
189b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith                                   const gfx::Point& point) OVERRIDE;
190b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith
191b04035a7b1a3c9b93cea72ae56dd2ea6e787bae9Richard Smith  // Overridden from views::DragController:
192b04035a7b1a3c9b93cea72ae56dd2ea6e787bae9Richard Smith  virtual void WriteDragDataForView(View* sender,
193b04035a7b1a3c9b93cea72ae56dd2ea6e787bae9Richard Smith                                    const gfx::Point& press_pt,
194b04035a7b1a3c9b93cea72ae56dd2ea6e787bae9Richard Smith                                    ui::OSExchangeData* data) OVERRIDE;
195b04035a7b1a3c9b93cea72ae56dd2ea6e787bae9Richard Smith  virtual int GetDragOperationsForView(View* sender,
196b04035a7b1a3c9b93cea72ae56dd2ea6e787bae9Richard Smith                                       const gfx::Point& p) OVERRIDE;
197b04035a7b1a3c9b93cea72ae56dd2ea6e787bae9Richard Smith  virtual bool CanStartDragForView(View* sender,
198b04035a7b1a3c9b93cea72ae56dd2ea6e787bae9Richard Smith                                   const gfx::Point& press_pt,
199b04035a7b1a3c9b93cea72ae56dd2ea6e787bae9Richard Smith                                   const gfx::Point& p) OVERRIDE;
200f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith
201f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // Overridden from views::ResizeAreaDelegate:
202f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  virtual void OnResize(int resize_amount, bool done_resizing) OVERRIDE;
203f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith
204f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // Overridden from gfx::AnimationDelegate:
205f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
206f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
207f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith
208f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // Overridden from BrowserActionOverflowMenuController::Observer:
209b4e85ed51905fc94378d7b4ff62b06e0d08042b7Richard Smith  virtual void NotifyMenuDeleted(
2107b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith      BrowserActionOverflowMenuController* controller) OVERRIDE;
2117b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith
2127b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // Overridden from views::WidgetObserver:
2137b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
2147b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith
2157b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // Overridden from BrowserActionView::Delegate:
2167b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  virtual void InspectPopup(ExtensionAction* action) OVERRIDE;
2177b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  virtual int GetCurrentTabId() const OVERRIDE;
2187b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  virtual void OnBrowserActionExecuted(BrowserActionButton* button) OVERRIDE;
2197b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  virtual void OnBrowserActionVisibilityChanged() OVERRIDE;
2207b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith
2217b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // Overridden from extension::ExtensionKeybindingRegistry::Delegate:
2227b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  virtual extensions::ActiveTabPermissionGranter*
2237b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith      GetActiveTabPermissionGranter() OVERRIDE;
2247b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith
2257b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // Moves a browser action with |id| to |new_index|.
2267b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  void MoveBrowserAction(const std::string& extension_id, size_t new_index);
2277b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith
2287b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // Shows the popup for |extension| if possible. Returns true if a new popup
2297b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // was shown. Showing the popup will grant tab permissions if
2307b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // |grant_tab_permissions| is true. Only pass true for this argument for
2317b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // popups triggered interactively, not popups triggered by an API.
2327b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  bool ShowPopup(const extensions::Extension* extension,
2337b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith                 bool grant_tab_permissions);
2347b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith
2357b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // Hide the current popup.
23615efc4d597a47e6ba5794d4fd8d561bf6947233cRichard Smith  void HidePopup();
23715efc4d597a47e6ba5794d4fd8d561bf6947233cRichard Smith
23815efc4d597a47e6ba5794d4fd8d561bf6947233cRichard Smith  // Simulate a click on a browser action button.  This should only be
23915efc4d597a47e6ba5794d4fd8d561bf6947233cRichard Smith  // used by unit tests.
24015efc4d597a47e6ba5794d4fd8d561bf6947233cRichard Smith  void TestExecuteBrowserAction(int index);
24115efc4d597a47e6ba5794d4fd8d561bf6947233cRichard Smith
24215efc4d597a47e6ba5794d4fd8d561bf6947233cRichard Smith  // Retrieve the current popup.  This should only be used by unit tests.
24315efc4d597a47e6ba5794d4fd8d561bf6947233cRichard Smith  ExtensionPopup* TestGetPopup() { return popup_; }
2447b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith
2457b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // Set how many icons the container should show. This should only be used by
2467b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // unit tests.
2477b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  void TestSetIconVisibilityCount(size_t icons);
2487b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith
2497b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // During testing we can disable animations by setting this flag to true,
2507b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // so that the bar resizes instantly, instead of having to poll it while it
2517b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // animates to open/closed status.
2527b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  static bool disable_animations_during_testing_;
2537b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith
2547b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith protected:
2557b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  // Overridden from views::View:
2567b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  virtual void ViewHierarchyChanged(
2577b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith      const ViewHierarchyChangedDetails& details) OVERRIDE;
2587b48a2986345480241f3b8209f71bb21b0530b4fRichard Smith  virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
259c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  virtual void OnThemeChanged() OVERRIDE;
260c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
261c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith private:
262c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  friend class BrowserActionView;  // So it can access IconWidth().
263c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  friend class ShowFolderMenuTask;
264c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
265c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  typedef std::vector<BrowserActionView*> BrowserActionViews;
266c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
267c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Returns the width of an icon, optionally with its padding.
268c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  static int IconWidth(bool include_padding);
2697098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith
2707098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // Returns the height of an icon.
2717098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  static int IconHeight();
2727098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith
2737098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // extensions::ExtensionToolbarModel::Observer implementation.
2749ec7197796a2730d54ae7f632553b5311b2ba3b5Richard Smith  virtual void BrowserActionAdded(const extensions::Extension* extension,
2757098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith                                  int index) OVERRIDE;
2767098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  virtual void BrowserActionRemoved(
2779ec7197796a2730d54ae7f632553b5311b2ba3b5Richard Smith      const extensions::Extension* extension) OVERRIDE;
2787098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  virtual void BrowserActionMoved(const extensions::Extension* extension,
2799ec7197796a2730d54ae7f632553b5311b2ba3b5Richard Smith                                  int index) OVERRIDE;
2807098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  virtual bool BrowserActionShowPopup(
2817098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith      const extensions::Extension* extension) OVERRIDE;
2827098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  virtual void VisibleCountChanged() OVERRIDE;
2837098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  virtual void HighlightModeChanged(bool is_highlighting) OVERRIDE;
2847098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith
2857098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  void LoadImages();
2867098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith
2877098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // Sets the initial container width.
288282e7e66748cc6dd14d6f7f2cb52e5373c531e61Richard Smith  void SetContainerWidth();
2897098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith
2907098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // Closes the overflow menu if open.
2919ec7197796a2730d54ae7f632553b5311b2ba3b5Richard Smith  void CloseOverflowMenu();
2927098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith
2937098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // Cancels the timer for showing the drop down menu.
2949ec7197796a2730d54ae7f632553b5311b2ba3b5Richard Smith  void StopShowFolderDropMenuTimer();
2959ec7197796a2730d54ae7f632553b5311b2ba3b5Richard Smith
2969ec7197796a2730d54ae7f632553b5311b2ba3b5Richard Smith  // Show the drop down folder after a slight delay.
2977098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  void StartShowFolderDropMenuTimer();
2989ec7197796a2730d54ae7f632553b5311b2ba3b5Richard Smith
2997098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // Show the overflow menu.
3007098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  void ShowDropFolder();
3017098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith
3027098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // Sets the drop indicator position (and schedules paint if the position has
3037098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // changed).
3047098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  void SetDropIndicator(int x_pos);
305282e7e66748cc6dd14d6f7f2cb52e5373c531e61Richard Smith
3067098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // Given a number of |icons| and whether to |display_chevron|, returns the
307c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // amount of pixels needed to draw the entire container.  For convenience,
3087098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // callers can set |icons| to -1 to mean "all icons".
3097098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  int IconCountToWidth(int icons, bool display_chevron) const;
3107098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith
311c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Given a pixel width, returns the number of icons that fit.  (This
312c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // automatically determines whether a chevron will be needed and includes it
313c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // in the calculation.)
314c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  size_t WidthToIconCount(int pixels) const;
315c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
316c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Returns the absolute minimum size you can shrink the container down to and
317c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // still show it.  This assumes a visible chevron because the only way we
318f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // would not have a chevron when shrinking down this far is if there were no
319f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // icons, in which case the container wouldn't be shown at all.
320f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  int ContainerMinSize() const;
321f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith
322f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // Animate to the target size (unless testing, in which case we go straight to
323f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // the target size).  This also saves the target number of visible icons in
324f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // the pref if we're not incognito.
325f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  void SaveDesiredSizeAndAnimate(gfx::Tween::Type type,
326f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith                                 size_t num_visible_icons);
327f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith
328f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // Returns true if this extension should be shown in this toolbar. This can
329f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // return false if we are in an incognito window and the extension is disabled
330f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  // for incognito.
331f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith  bool ShouldDisplayBrowserAction(const extensions::Extension* extension);
332f15fda02e9c8c82b4a716618f4010b9af8bff796Richard Smith
333c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Show a popup. Returns true if a new popup was shown. Showing the popup will
334c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // grant tab permissions if |grant_tab_permissions| is true. Only pass true
335c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // for this argument for popups triggered interactively, not popups triggered
336c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // by an API.
337c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  bool ShowPopup(BrowserActionButton* button,
338c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith                 ExtensionPopup::ShowAction show_action,
339c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith                 bool grant_tab_permissions);
3407098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith
341c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The vector of browser actions (icons/image buttons for each action). Note
342c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // that not every BrowserAction in the ToolbarModel will necessarily be in
343c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // this collection. Some extensions may be disabled in incognito windows.
344c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  BrowserActionViews browser_action_views_;
345099e7f647ccda915513f2b2ec53352dc756082d3Richard Smith
346099e7f647ccda915513f2b2ec53352dc756082d3Richard Smith  Profile* profile_;
347c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
348c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The Browser object the container is associated with.
349c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  Browser* browser_;
350c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
351c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The view that owns us.
352c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  views::View* owner_view_;
3537098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith
3547098cbd601ad915aed22d4b5850da99359f25bf3Richard Smith  // The current popup and the button it came from.  NULL if no popup.
355c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  ExtensionPopup* popup_;
356c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
357c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The button that triggered the current popup (just a reference to a button
358c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // from browser_action_views_).
359c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  BrowserActionButton* popup_button_;
360099e7f647ccda915513f2b2ec53352dc756082d3Richard Smith
361c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The model that tracks the order of the toolbar icons.
362c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  extensions::ExtensionToolbarModel* model_;
363c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
364c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The current width of the container.
365c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  int container_width_;
366c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
367c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The resize area for the container.
368c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  views::ResizeArea* resize_area_;
369c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
370c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The chevron for accessing the overflow items.
371c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  views::MenuButton* chevron_;
372c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
373c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The painter used when we are highlighting a subset of extensions.
374c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  scoped_ptr<views::Painter> highlight_painter_;
375c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
376c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The menu to show for the overflow button (chevron). This class manages its
377c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // own lifetime so that it can stay alive during drag and drop operations.
378c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  BrowserActionOverflowMenuController* overflow_menu_;
379c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
380c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The animation that happens when the container snaps to place.
381c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  scoped_ptr<gfx::SlideAnimation> resize_animation_;
382c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
383c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Don't show the chevron while animating.
384c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  bool suppress_chevron_;
385c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
386c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // This is used while the user is resizing (and when the animations are in
387c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // progress) to know how wide the delta is between the current state and what
388c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // we should draw.
389c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  int resize_amount_;
390c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
391c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Keeps track of the absolute pixel width the container should have when we
392282e7e66748cc6dd14d6f7f2cb52e5373c531e61Richard Smith  // are done animating.
393c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  int animation_target_size_;
394c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
395c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The x position for where to draw the drop indicator. -1 if no indicator.
396c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  int drop_indicator_position_;
397c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
398c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // The class that registers for keyboard shortcuts for extension commands.
399c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_;
400c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
401c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  base::WeakPtrFactory<BrowserActionsContainer> task_factory_;
402c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
403c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  // Handles delayed showing of the overflow menu when hovering.
404c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_;
405c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
406c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  ObserverList<BrowserActionsContainerObserver> observers_;
407c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
408c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith  DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer);
409c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith};
410c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith
411c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith#endif  // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTIONS_CONTAINER_H_
412c1c5f27c64dfc3332d53ad30e44d626e4f9afac3Richard Smith