Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_actions_bar.h

Issue 1858773006: [Extensions UI] Use the ExtensionMessageBubbleBridge for Views platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory>
11
10 #include "base/callback.h" 12 #include "base/callback.h"
11 #include "base/macros.h" 13 #include "base/macros.h"
12 #include "base/memory/scoped_vector.h" 14 #include "base/memory/scoped_vector.h"
13 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
14 #include "base/observer_list.h" 16 #include "base/observer_list.h"
15 #include "base/scoped_observer.h" 17 #include "base/scoped_observer.h"
16 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" 18 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h"
17 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" 19 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h"
18 #include "ui/gfx/animation/tween.h" 20 #include "ui/gfx/animation/tween.h"
19 #include "ui/gfx/geometry/size.h" 21 #include "ui/gfx/geometry/size.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // |drag_type| indicates whether or not the icon was dragged between the 176 // |drag_type| indicates whether or not the icon was dragged between the
175 // overflow and main containers. 177 // overflow and main containers.
176 // The main container should handle all drag/drop notifications. 178 // The main container should handle all drag/drop notifications.
177 void OnDragDrop(int dragged_index, 179 void OnDragDrop(int dragged_index,
178 int dropped_index, 180 int dropped_index,
179 DragType drag_type); 181 DragType drag_type);
180 182
181 // Notifies the ToolbarActionsBar that the delegate finished animating. 183 // Notifies the ToolbarActionsBar that the delegate finished animating.
182 void OnAnimationEnded(); 184 void OnAnimationEnded();
183 185
186 // Called when the active bubble is closed.
187 void OnBubbleClosed();
188
184 // Returns true if the given |action| is visible on the main toolbar. 189 // Returns true if the given |action| is visible on the main toolbar.
185 bool IsActionVisibleOnMainBar(const ToolbarActionViewController* action) 190 bool IsActionVisibleOnMainBar(const ToolbarActionViewController* action)
186 const; 191 const;
187 192
188 // Pops out a given |action|, ensuring it is visible. 193 // Pops out a given |action|, ensuring it is visible.
189 // |is_sticky| refers to whether or not the action will stay popped out if 194 // |is_sticky| refers to whether or not the action will stay popped out if
190 // the overflow menu is opened. 195 // the overflow menu is opened.
191 // |closure| will be called once any animation is complete. 196 // |closure| will be called once any animation is complete.
192 void PopOutAction(ToolbarActionViewController* action, 197 void PopOutAction(ToolbarActionViewController* action,
193 bool is_sticky, 198 bool is_sticky,
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 ToolbarActionViewController* popped_out_action_; 335 ToolbarActionViewController* popped_out_action_;
331 336
332 // True if the popped out action is "sticky", meaning it will stay popped 337 // True if the popped out action is "sticky", meaning it will stay popped
333 // out even if another menu is opened. 338 // out even if another menu is opened.
334 bool is_popped_out_sticky_; 339 bool is_popped_out_sticky_;
335 340
336 // The task to alert the |popped_out_action_| that animation has finished, and 341 // The task to alert the |popped_out_action_| that animation has finished, and
337 // it is fully popped out. 342 // it is fully popped out.
338 base::Closure popped_out_closure_; 343 base::Closure popped_out_closure_;
339 344
340 // The controller of the extension message bubble to show once animation
341 // finishes, if any. This has priority over
342 // |pending_toolbar_bubble_controller_|.
343 std::unique_ptr<extensions::ExtensionMessageBubbleController>
344 pending_extension_bubble_controller_;
345
346 // The controller for the toolbar action bubble to show once animation 345 // The controller for the toolbar action bubble to show once animation
347 // finishes, if any. 346 // finishes, if any.
348 std::unique_ptr<ToolbarActionsBarBubbleDelegate> 347 std::unique_ptr<ToolbarActionsBarBubbleDelegate> pending_bubble_controller_;
349 pending_toolbar_bubble_controller_; 348
349 // True if a bubble is currently being shown.
350 bool is_showing_bubble_;
350 351
351 base::ObserverList<ToolbarActionsBarObserver> observers_; 352 base::ObserverList<ToolbarActionsBarObserver> observers_;
352 353
353 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; 354 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_;
354 355
355 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); 356 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar);
356 }; 357 };
357 358
358 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ 359 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698