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