| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // Returns the [minimum|maximum] possible width for the toolbar. | 94 // Returns the [minimum|maximum] possible width for the toolbar. |
| 95 int GetMinimumWidth() const; | 95 int GetMinimumWidth() const; |
| 96 int GetMaximumWidth() const; | 96 int GetMaximumWidth() const; |
| 97 | 97 |
| 98 // Returns the width for the given number of icons. | 98 // Returns the width for the given number of icons. |
| 99 int IconCountToWidth(int icons) const; | 99 int IconCountToWidth(int icons) const; |
| 100 | 100 |
| 101 // Returns the number of icons that can fit within the given width. | 101 // Returns the number of icons that can fit within the given width. |
| 102 size_t WidthToIconCount(int width) const; | 102 size_t WidthToIconCount(int width) const; |
| 103 | 103 |
| 104 // Returns the number of icons that should be displayed. | 104 // Returns the number of icons that should be displayed if space allows. |
| 105 size_t GetIconCount() const; | 105 size_t GetIconCount() const; |
| 106 | 106 |
| 107 // Returns the starting index (inclusive) for displayable icons. |
| 108 size_t GetStartIndexInBounds() const; |
| 109 |
| 110 // Returns the ending index (exclusive) for displayable icons. |
| 111 size_t GetEndIndexInBounds() const; |
| 112 |
| 113 // Returns true if an overflow container is necessary to display any other |
| 114 // icons. |
| 115 bool NeedsOverflow() const; |
| 116 |
| 107 // Returns the frame (bounds) that the specified index should have, taking | 117 // Returns the frame (bounds) that the specified index should have, taking |
| 108 // into account if this is the main or overflow bar. If this is the overflow | 118 // into account if this is the main or overflow bar. If this is the overflow |
| 109 // bar and the index should not be displayed (i.e., it is shown on the main | 119 // bar and the index should not be displayed (i.e., it is shown on the main |
| 110 // bar), returns an empty rect. | 120 // bar), returns an empty rect. |
| 111 gfx::Rect GetFrameForIndex(size_t index) const; | 121 gfx::Rect GetFrameForIndex(size_t index) const; |
| 112 | 122 |
| 113 // Returns the actions in the proper order; this may differ from the | 123 // Returns the actions in the proper order; this may differ from the |
| 114 // underlying order in the case of actions being popped out to show a popup. | 124 // underlying order in the case of actions being popped out to show a popup. |
| 115 std::vector<ToolbarActionViewController*> GetActions() const; | 125 std::vector<ToolbarActionViewController*> GetActions() const; |
| 116 | 126 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // The controller of the bubble to show once animation finishes, if any. | 297 // The controller of the bubble to show once animation finishes, if any. |
| 288 scoped_ptr<extensions::ExtensionMessageBubbleController> | 298 scoped_ptr<extensions::ExtensionMessageBubbleController> |
| 289 pending_extension_bubble_controller_; | 299 pending_extension_bubble_controller_; |
| 290 | 300 |
| 291 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; | 301 base::WeakPtrFactory<ToolbarActionsBar> weak_ptr_factory_; |
| 292 | 302 |
| 293 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); | 303 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBar); |
| 294 }; | 304 }; |
| 295 | 305 |
| 296 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ | 306 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_H_ |
| OLD | NEW |