| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/scoped_vector.h" |
| 13 #include "base/sequenced_task_runner_helpers.h" | 14 #include "base/sequenced_task_runner_helpers.h" |
| 14 #include "ui/views/controls/menu/menu_delegate.h" | 15 #include "ui/views/controls/menu/menu_delegate.h" |
| 15 | 16 |
| 16 class Browser; | 17 class Browser; |
| 17 class BrowserActionsContainer; | 18 class BrowserActionsContainer; |
| 18 class BrowserActionView; | 19 class BrowserActionView; |
| 19 | 20 |
| 21 class IconUpdater; |
| 22 |
| 20 namespace views { | 23 namespace views { |
| 21 class MenuRunner; | 24 class MenuRunner; |
| 22 class Widget; | 25 class Widget; |
| 23 } | 26 } |
| 24 | 27 |
| 25 // This class handles the overflow menu for browser actions (showing the menu, | 28 // This class handles the overflow menu for browser actions (showing the menu, |
| 26 // drag and drop, etc). This class manages its own lifetime. | 29 // drag and drop, etc). This class manages its own lifetime. |
| 27 class BrowserActionOverflowMenuController : public views::MenuDelegate { | 30 class BrowserActionOverflowMenuController : public views::MenuDelegate { |
| 28 public: | 31 public: |
| 29 // The observer is notified prior to the menu being deleted. | 32 // The observer is notified prior to the menu being deleted. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // won't show all items, just the one starting at |start_index| and above. | 111 // won't show all items, just the one starting at |start_index| and above. |
| 109 const std::vector<BrowserActionView*>* views_; | 112 const std::vector<BrowserActionView*>* views_; |
| 110 | 113 |
| 111 // The index into the BrowserActionView vector, indicating where to start | 114 // The index into the BrowserActionView vector, indicating where to start |
| 112 // picking browser actions to draw. | 115 // picking browser actions to draw. |
| 113 int start_index_; | 116 int start_index_; |
| 114 | 117 |
| 115 // Whether this controller is being used for drop. | 118 // Whether this controller is being used for drop. |
| 116 bool for_drop_; | 119 bool for_drop_; |
| 117 | 120 |
| 121 // The vector keeps all icon updaters associated with menu item views in the |
| 122 // controller. The icon updater will update the menu item view's icon when |
| 123 // the browser action view's icon has been updated. |
| 124 ScopedVector<IconUpdater> icon_updaters_; |
| 125 |
| 118 friend class base::DeleteHelper<BrowserActionOverflowMenuController>; | 126 friend class base::DeleteHelper<BrowserActionOverflowMenuController>; |
| 119 | 127 |
| 120 DISALLOW_COPY_AND_ASSIGN(BrowserActionOverflowMenuController); | 128 DISALLOW_COPY_AND_ASSIGN(BrowserActionOverflowMenuController); |
| 121 }; | 129 }; |
| 122 | 130 |
| 123 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_BROWSER_ACTION_OVERFLOW_MENU_CONTR
OLLER_H_ | 131 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_BROWSER_ACTION_OVERFLOW_MENU_CONTR
OLLER_H_ |
| OLD | NEW |