| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_VIEWS_EXTENSIONS_BROWSER_ACTION_OVERFLOW_MENU_CONTROLLER_
H_ | 5 #ifndef CHROME_BROWSER_VIEWS_EXTENSIONS_BROWSER_ACTION_OVERFLOW_MENU_CONTROLLER_
H_ |
| 6 #define CHROME_BROWSER_VIEWS_EXTENSIONS_BROWSER_ACTION_OVERFLOW_MENU_CONTROLLER_
H_ | 6 #define CHROME_BROWSER_VIEWS_EXTENSIONS_BROWSER_ACTION_OVERFLOW_MENU_CONTROLLER_
H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/scoped_ptr.h" |
| 12 #include "base/task.h" |
| 11 #include "views/controls/menu/menu_delegate.h" | 13 #include "views/controls/menu/menu_delegate.h" |
| 12 | 14 |
| 13 class BrowserActionsContainer; | 15 class BrowserActionsContainer; |
| 14 class BrowserActionView; | 16 class BrowserActionView; |
| 15 class ExtensionActionContextMenu; | 17 class ExtensionContextMenuModel; |
| 18 |
| 19 namespace views { |
| 20 class Menu2; |
| 21 } |
| 16 | 22 |
| 17 // This class handles the overflow menu for browser actions (showing the menu, | 23 // This class handles the overflow menu for browser actions (showing the menu, |
| 18 // drag and drop, etc). This class manages its own lifetime. | 24 // drag and drop, etc). This class manages its own lifetime. |
| 19 class BrowserActionOverflowMenuController : public views::MenuDelegate { | 25 class BrowserActionOverflowMenuController : public views::MenuDelegate { |
| 20 public: | 26 public: |
| 21 // The observer is notified prior to the menu being deleted. | 27 // The observer is notified prior to the menu being deleted. |
| 22 class Observer { | 28 class Observer { |
| 23 public: | 29 public: |
| 24 virtual void NotifyMenuDeleted( | 30 virtual void NotifyMenuDeleted( |
| 25 BrowserActionOverflowMenuController* controller) = 0; | 31 BrowserActionOverflowMenuController* controller) = 0; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // won't show all items, just the one starting at |start_index| and above. | 97 // won't show all items, just the one starting at |start_index| and above. |
| 92 const std::vector<BrowserActionView*>* views_; | 98 const std::vector<BrowserActionView*>* views_; |
| 93 | 99 |
| 94 // The index into the BrowserActionView vector, indicating where to start | 100 // The index into the BrowserActionView vector, indicating where to start |
| 95 // picking browser actions to draw. | 101 // picking browser actions to draw. |
| 96 int start_index_; | 102 int start_index_; |
| 97 | 103 |
| 98 // Whether this controller is being used for drop. | 104 // Whether this controller is being used for drop. |
| 99 bool for_drop_; | 105 bool for_drop_; |
| 100 | 106 |
| 107 // The browser action context menu and model. |
| 108 scoped_ptr<ExtensionContextMenuModel> context_menu_contents_; |
| 109 scoped_ptr<views::Menu2> context_menu_menu_; |
| 110 |
| 111 friend class DeleteTask<BrowserActionOverflowMenuController>; |
| 112 |
| 101 DISALLOW_COPY_AND_ASSIGN(BrowserActionOverflowMenuController); | 113 DISALLOW_COPY_AND_ASSIGN(BrowserActionOverflowMenuController); |
| 102 }; | 114 }; |
| 103 | 115 |
| 104 #endif // CHROME_BROWSER_VIEWS_EXTENSIONS_BROWSER_ACTION_OVERFLOW_MENU_CONTROLL
ER_H_ | 116 #endif // CHROME_BROWSER_VIEWS_EXTENSIONS_BROWSER_ACTION_OVERFLOW_MENU_CONTROLL
ER_H_ |
| OLD | NEW |