Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.h

Issue 148143004: Add notification mechanism when BrowserActionButton's icon has been updated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/sequenced_task_runner_helpers.h" 13 #include "base/sequenced_task_runner_helpers.h"
14 #include "ui/views/controls/menu/menu_delegate.h" 14 #include "ui/views/controls/menu/menu_delegate.h"
15 15
16 class Browser; 16 class Browser;
17 class BrowserActionsContainer; 17 class BrowserActionsContainer;
18 class BrowserActionView; 18 class BrowserActionView;
19 19
20 class IconUpdater;
21
20 namespace views { 22 namespace views {
21 class MenuRunner; 23 class MenuRunner;
22 class Widget; 24 class Widget;
23 } 25 }
24 26
25 // This class handles the overflow menu for browser actions (showing the menu, 27 // This class handles the overflow menu for browser actions (showing the menu,
26 // drag and drop, etc). This class manages its own lifetime. 28 // drag and drop, etc). This class manages its own lifetime.
27 class BrowserActionOverflowMenuController : public views::MenuDelegate { 29 class BrowserActionOverflowMenuController : public views::MenuDelegate {
28 public: 30 public:
29 // The observer is notified prior to the menu being deleted. 31 // The observer is notified prior to the menu being deleted.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // won't show all items, just the one starting at |start_index| and above. 110 // won't show all items, just the one starting at |start_index| and above.
109 const std::vector<BrowserActionView*>* views_; 111 const std::vector<BrowserActionView*>* views_;
110 112
111 // The index into the BrowserActionView vector, indicating where to start 113 // The index into the BrowserActionView vector, indicating where to start
112 // picking browser actions to draw. 114 // picking browser actions to draw.
113 int start_index_; 115 int start_index_;
114 116
115 // Whether this controller is being used for drop. 117 // Whether this controller is being used for drop.
116 bool for_drop_; 118 bool for_drop_;
117 119
120 // The vector keeps all icon updaters associated with menu item views in the
121 // controller. The icon updater will update the menu item view's icon when
122 // the browser action view's icon has been updated.
123 std::vector<IconUpdater*> icon_updaters_;
sky 2014/02/24 16:34:17 How about a scopedvector?
124
118 friend class base::DeleteHelper<BrowserActionOverflowMenuController>; 125 friend class base::DeleteHelper<BrowserActionOverflowMenuController>;
119 126
120 DISALLOW_COPY_AND_ASSIGN(BrowserActionOverflowMenuController); 127 DISALLOW_COPY_AND_ASSIGN(BrowserActionOverflowMenuController);
121 }; 128 };
122 129
123 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_BROWSER_ACTION_OVERFLOW_MENU_CONTR OLLER_H_ 130 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_BROWSER_ACTION_OVERFLOW_MENU_CONTR OLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698