| OLD | NEW |
| 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> | 10 #include <memory> |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // A struct to contain the platform settings. | 53 // A struct to contain the platform settings. |
| 54 struct PlatformSettings { | 54 struct PlatformSettings { |
| 55 PlatformSettings(); | 55 PlatformSettings(); |
| 56 | 56 |
| 57 // The spacing between each of the icons, between the start of the | 57 // The spacing between each of the icons, between the start of the |
| 58 // container and the first item, and between the last item and end of | 58 // container and the first item, and between the last item and end of |
| 59 // the container. | 59 // the container. |
| 60 int item_spacing; | 60 int item_spacing; |
| 61 // The number of icons per row in the overflow menu. | 61 // The number of icons per row in the overflow menu. |
| 62 int icons_per_overflow_menu_row; | 62 int icons_per_overflow_menu_row; |
| 63 // Whether or not the overflow menu is displayed as a chevron (this is being | |
| 64 // phased out). | |
| 65 bool chevron_enabled; | |
| 66 }; | 63 }; |
| 67 | 64 |
| 68 // The type of drag that occurred in a drag-and-drop operation. | 65 // The type of drag that occurred in a drag-and-drop operation. |
| 69 enum DragType { | 66 enum DragType { |
| 70 // The icon was dragged to the same container it started in. | 67 // The icon was dragged to the same container it started in. |
| 71 DRAG_TO_SAME, | 68 DRAG_TO_SAME, |
| 72 // The icon was dragged from the main container to the overflow. | 69 // The icon was dragged from the main container to the overflow. |
| 73 DRAG_TO_OVERFLOW, | 70 DRAG_TO_OVERFLOW, |
| 74 // The icon was dragged from the overflow container to the main. | 71 // The icon was dragged from the overflow container to the main. |
| 75 DRAG_TO_MAIN, | 72 DRAG_TO_MAIN, |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 void OnToolbarHighlightModeChanged(bool is_highlighting) override; | 264 void OnToolbarHighlightModeChanged(bool is_highlighting) override; |
| 268 void OnToolbarModelInitialized() override; | 265 void OnToolbarModelInitialized() override; |
| 269 | 266 |
| 270 // TabStripModelObserver: | 267 // TabStripModelObserver: |
| 271 void TabInsertedAt(TabStripModel* tab_strip_model, | 268 void TabInsertedAt(TabStripModel* tab_strip_model, |
| 272 content::WebContents* contents, | 269 content::WebContents* contents, |
| 273 int index, | 270 int index, |
| 274 bool foreground) override; | 271 bool foreground) override; |
| 275 | 272 |
| 276 // Resizes the delegate (if necessary) to the preferred size using the given | 273 // Resizes the delegate (if necessary) to the preferred size using the given |
| 277 // |tween_type| and optionally suppressing the chevron. | 274 // |tween_type|. |
| 278 void ResizeDelegate(gfx::Tween::Type tween_type, bool suppress_chevron); | 275 void ResizeDelegate(gfx::Tween::Type tween_type); |
| 279 | 276 |
| 280 // Returns the action for the given |id|, if one exists. | 277 // Returns the action for the given |id|, if one exists. |
| 281 ToolbarActionViewController* GetActionForId(const std::string& action_id); | 278 ToolbarActionViewController* GetActionForId(const std::string& action_id); |
| 282 | 279 |
| 283 // Returns the current web contents. | 280 // Returns the current web contents. |
| 284 content::WebContents* GetCurrentWebContents(); | 281 content::WebContents* GetCurrentWebContents(); |
| 285 | 282 |
| 286 // Reorders the toolbar actions to reflect the model and, optionally, to | 283 // Reorders the toolbar actions to reflect the model and, optionally, to |
| 287 // "pop out" any overflowed actions that want to run (depending on the | 284 // "pop out" any overflowed actions that want to run (depending on the |
| 288 // value of |pop_out_actions_to_run|. | 285 // value of |pop_out_actions_to_run|. |
| 289 void ReorderActions(); | 286 void ReorderActions(); |
| 290 | 287 |
| 291 // Shows an extension message bubble, if any should be shown. | 288 // Shows an extension message bubble, if any should be shown. |
| 292 void MaybeShowExtensionBubble(); | 289 void MaybeShowExtensionBubble(); |
| 293 | 290 |
| 294 // The delegate for this object (in a real build, this is the view). | 291 // The delegate for this object (in a real build, this is the view). |
| 295 ToolbarActionsBarDelegate* delegate_; | 292 ToolbarActionsBarDelegate* delegate_; |
| 296 | 293 |
| 297 // The associated browser. | 294 // The associated browser. |
| 298 Browser* browser_; | 295 Browser* browser_; |
| 299 | 296 |
| 300 // The observed toolbar model. | 297 // The observed toolbar model. |
| 301 ToolbarActionsModel* model_; | 298 ToolbarActionsModel* model_; |
| 302 | 299 |
| 303 // The controller for the main toolbar actions bar. This will be null if this | 300 // The controller for the main toolbar actions bar. This will be null if this |
| 304 // is the main bar. | 301 // is the main bar. |
| 305 ToolbarActionsBar* main_bar_; | 302 ToolbarActionsBar* main_bar_; |
| 306 | 303 |
| 307 // Platform-specific settings for dimensions and the overflow chevron. | 304 // Platform-specific settings for dimensions. |
| 308 PlatformSettings platform_settings_; | 305 PlatformSettings platform_settings_; |
| 309 | 306 |
| 310 // The toolbar actions. | 307 // The toolbar actions. |
| 311 ToolbarActions toolbar_actions_; | 308 ToolbarActions toolbar_actions_; |
| 312 | 309 |
| 313 // The action that triggered the current popup (just a reference to an action | 310 // The action that triggered the current popup (just a reference to an action |
| 314 // from toolbar_actions_). | 311 // from toolbar_actions_). |
| 315 ToolbarActionViewController* popup_owner_; | 312 ToolbarActionViewController* popup_owner_; |
| 316 | 313 |
| 317 ScopedObserver<ToolbarActionsModel, ToolbarActionsModel::Observer> | 314 ScopedObserver<ToolbarActionsModel, ToolbarActionsModel::Observer> |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 ScopedObserver<TabStripModel, TabStripModelObserver> tab_strip_observer_; | 357 ScopedObserver<TabStripModel, TabStripModelObserver> tab_strip_observer_; |
| 361 | 358 |
| 362 base::ObserverList<ToolbarActionsBarObserver> observers_; | 359 base::ObserverList<ToolbarActionsBarObserver> observers_; |
| 363 | 360 |
| 364 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; | 361 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; |
| 365 | 362 |
| 366 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); | 363 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); |
| 367 }; | 364 }; |
| 368 | 365 |
| 369 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ | 366 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ |
| OLD | NEW |