| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VIEWS_TOOLBAR_BROWSER_ACTIONS_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTIONS_CONTAINER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTIONS_CONTAINER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTIONS_CONTAINER_H_ |
| 7 | 7 |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "chrome/browser/extensions/extension_keybinding_registry.h" | 9 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
| 10 #include "chrome/browser/extensions/extension_toolbar_model.h" | 10 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 // Returns how many browser actions will be visible once the container | 181 // Returns how many browser actions will be visible once the container |
| 182 // finishes animating to a new size, or (if not animating) the currently | 182 // finishes animating to a new size, or (if not animating) the currently |
| 183 // visible icons. | 183 // visible icons. |
| 184 size_t VisibleBrowserActionsAfterAnimation() const; | 184 size_t VisibleBrowserActionsAfterAnimation() const; |
| 185 | 185 |
| 186 // Executes |command| registered by |extension|. | 186 // Executes |command| registered by |extension|. |
| 187 void ExecuteExtensionCommand(const extensions::Extension* extension, | 187 void ExecuteExtensionCommand(const extensions::Extension* extension, |
| 188 const extensions::Command& command); | 188 const extensions::Command& command); |
| 189 | 189 |
| 190 // Notify the browser action container that an extension has been moved to |
| 191 // the overflow container. |
| 192 void NotifyActionMovedToOverflow(); |
| 193 |
| 190 // Add or remove an observer. | 194 // Add or remove an observer. |
| 191 void AddObserver(BrowserActionsContainerObserver* observer); | 195 void AddObserver(BrowserActionsContainerObserver* observer); |
| 192 void RemoveObserver(BrowserActionsContainerObserver* observer); | 196 void RemoveObserver(BrowserActionsContainerObserver* observer); |
| 193 | 197 |
| 194 // Overridden from views::View: | 198 // Overridden from views::View: |
| 195 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 199 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 196 virtual gfx::Size GetMinimumSize() const OVERRIDE; | 200 virtual gfx::Size GetMinimumSize() const OVERRIDE; |
| 197 virtual void Layout() OVERRIDE; | 201 virtual void Layout() OVERRIDE; |
| 198 virtual bool GetDropFormats(int* formats, | 202 virtual bool GetDropFormats(int* formats, |
| 199 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; | 203 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 size_t GetFirstVisibleIconIndex() const; | 348 size_t GetFirstVisibleIconIndex() const; |
| 345 | 349 |
| 346 // Returns the number of icons that this container should draw. This differs | 350 // Returns the number of icons that this container should draw. This differs |
| 347 // from the model's GetVisibleIconCount if this container is for the overflow. | 351 // from the model's GetVisibleIconCount if this container is for the overflow. |
| 348 size_t GetIconCount() const; | 352 size_t GetIconCount() const; |
| 349 | 353 |
| 350 // Whether this container is in overflow mode (as opposed to in 'main' | 354 // Whether this container is in overflow mode (as opposed to in 'main' |
| 351 // mode). See class comments for details on the difference. | 355 // mode). See class comments for details on the difference. |
| 352 bool in_overflow_mode() const { return main_container_ != NULL; } | 356 bool in_overflow_mode() const { return main_container_ != NULL; } |
| 353 | 357 |
| 358 // Whether or not the container has been initialized. |
| 359 bool initialized_; |
| 360 |
| 354 // The vector of browser actions (icons/image buttons for each action). Note | 361 // The vector of browser actions (icons/image buttons for each action). Note |
| 355 // that not every BrowserAction in the ToolbarModel will necessarily be in | 362 // that not every BrowserAction in the ToolbarModel will necessarily be in |
| 356 // this collection. Some extensions may be disabled in incognito windows. | 363 // this collection. Some extensions may be disabled in incognito windows. |
| 357 BrowserActionViews browser_action_views_; | 364 BrowserActionViews browser_action_views_; |
| 358 | 365 |
| 359 Profile* profile_; | 366 Profile* profile_; |
| 360 | 367 |
| 361 // The Browser object the container is associated with. | 368 // The Browser object the container is associated with. |
| 362 Browser* browser_; | 369 Browser* browser_; |
| 363 | 370 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 424 |
| 418 // Handles delayed showing of the overflow menu when hovering. | 425 // Handles delayed showing of the overflow menu when hovering. |
| 419 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; | 426 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; |
| 420 | 427 |
| 421 ObserverList<BrowserActionsContainerObserver> observers_; | 428 ObserverList<BrowserActionsContainerObserver> observers_; |
| 422 | 429 |
| 423 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); | 430 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); |
| 424 }; | 431 }; |
| 425 | 432 |
| 426 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTIONS_CONTAINER_H_ | 433 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTIONS_CONTAINER_H_ |
| OLD | NEW |