| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // The type of drag that occurred in a drag-and-drop operation. | 60 // The type of drag that occurred in a drag-and-drop operation. |
| 61 enum DragType { | 61 enum DragType { |
| 62 // The icon was dragged to the same container it started in. | 62 // The icon was dragged to the same container it started in. |
| 63 DRAG_TO_SAME, | 63 DRAG_TO_SAME, |
| 64 // The icon was dragged from the main container to the overflow. | 64 // The icon was dragged from the main container to the overflow. |
| 65 DRAG_TO_OVERFLOW, | 65 DRAG_TO_OVERFLOW, |
| 66 // The icon was dragged from the overflow container to the main. | 66 // The icon was dragged from the overflow container to the main. |
| 67 DRAG_TO_MAIN, | 67 DRAG_TO_MAIN, |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 enum HighlightType { |
| 71 HIGHLIGHT_NONE, |
| 72 HIGHLIGHT_INFO, |
| 73 HIGHLIGHT_WARNING, |
| 74 }; |
| 75 |
| 70 ToolbarActionsBar(ToolbarActionsBarDelegate* delegate, | 76 ToolbarActionsBar(ToolbarActionsBarDelegate* delegate, |
| 71 Browser* browser, | 77 Browser* browser, |
| 72 ToolbarActionsBar* main_bar); | 78 ToolbarActionsBar* main_bar); |
| 73 ~ToolbarActionsBar() override; | 79 ~ToolbarActionsBar() override; |
| 74 | 80 |
| 75 // Returns the width of a browser action icon, optionally including the | 81 // Returns the width of a browser action icon, optionally including the |
| 76 // following padding. | 82 // following padding. |
| 77 static int IconWidth(bool include_padding); | 83 static int IconWidth(bool include_padding); |
| 78 | 84 |
| 79 // Returns the height of a browser action icon. | 85 // Returns the height of a browser action icon. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 96 // Returns the number of icons that can fit within the given width. | 102 // Returns the number of icons that can fit within the given width. |
| 97 size_t WidthToIconCount(int width) const; | 103 size_t WidthToIconCount(int width) const; |
| 98 | 104 |
| 99 // Returns the number of icons that should be displayed. | 105 // Returns the number of icons that should be displayed. |
| 100 size_t GetIconCount() const; | 106 size_t GetIconCount() const; |
| 101 | 107 |
| 102 // Returns the actions in the proper order; this may differ from the | 108 // Returns the actions in the proper order; this may differ from the |
| 103 // underlying order in the case of actions being popped out to show a popup. | 109 // underlying order in the case of actions being popped out to show a popup. |
| 104 std::vector<ToolbarActionViewController*> GetActions() const; | 110 std::vector<ToolbarActionViewController*> GetActions() const; |
| 105 | 111 |
| 112 // Returns the current highlight type. |
| 113 HighlightType GetHighlightType() const; |
| 114 |
| 106 // Creates the toolbar actions. | 115 // Creates the toolbar actions. |
| 107 void CreateActions(); | 116 void CreateActions(); |
| 108 | 117 |
| 109 // Deletes all toolbar actions. | 118 // Deletes all toolbar actions. |
| 110 void DeleteActions(); | 119 void DeleteActions(); |
| 111 | 120 |
| 112 // Updates all the toolbar actions. | 121 // Updates all the toolbar actions. |
| 113 void Update(); | 122 void Update(); |
| 114 | 123 |
| 115 // Sets the width for the overflow menu rows. | 124 // Sets the width for the overflow menu rows. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // The controller of the bubble to show once animation finishes, if any. | 298 // The controller of the bubble to show once animation finishes, if any. |
| 290 scoped_ptr<extensions::ExtensionMessageBubbleController> | 299 scoped_ptr<extensions::ExtensionMessageBubbleController> |
| 291 pending_extension_bubble_controller_; | 300 pending_extension_bubble_controller_; |
| 292 | 301 |
| 293 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; | 302 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; |
| 294 | 303 |
| 295 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); | 304 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); |
| 296 }; | 305 }; |
| 297 | 306 |
| 298 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ | 307 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ |
| OLD | NEW |