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

Unified Diff: chrome/browser/ui/views/action_box_menu.cc

Issue 11026076: Added MenuConfig setter to MenuItemView, updated rest of the code to use set MenuConfig if it avail… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_config.h » ('j') | ui/views/controls/menu/menu_item_view.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/action_box_menu.cc
diff --git a/chrome/browser/ui/views/action_box_menu.cc b/chrome/browser/ui/views/action_box_menu.cc
index 7dc1f6f7b43f250893cf8ebf69e90b2a0f835c39..8a1d63bad0b842d5bf7fc73d78d0192630951c00 100644
--- a/chrome/browser/ui/views/action_box_menu.cc
+++ b/chrome/browser/ui/views/action_box_menu.cc
@@ -12,6 +12,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/controls/button/menu_button.h"
+#include "ui/views/controls/menu/menu_config.h"
#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/view.h"
@@ -21,6 +22,18 @@
#include "ui/base/native_theme/native_theme_win.h"
#endif
+struct ActionBoxMenuConfig : public views::MenuConfig {
sky 2012/10/08 21:32:26 MenuConfig isn't set up for subclassing for two re
yefimt 2012/10/08 22:32:01 Done.
+ public:
+ ActionBoxMenuConfig() : menu_config_(NULL) {
+ menu_config_ = Create();
+ CustomizeMenu();
+ }
+ void CustomizeMenu() {
+ // TODO(yefim): add menu customization here.
+ }
+ views::MenuConfig* menu_config_;
sky 2012/10/08 21:32:26 There's no need for this now, right?
yefimt 2012/10/08 22:32:01 Done.
+};
+
// static
scoped_ptr<ActionBoxMenu> ActionBoxMenu::Create(
Browser* browser,
@@ -52,6 +65,11 @@ ActionBoxMenu::ActionBoxMenu(Browser* browser,
model_(model.Pass()) {
views::MenuItemView* menu = new views::MenuItemView(this);
menu->set_has_icons(true);
+ ActionBoxMenuConfig menu_config;
+ // |menu| will own MenuConfig
+ menu->set_menu_config(menu_config.menu_config_);
+ menu_config.menu_config_ = NULL;
+
menu_runner_.reset(new views::MenuRunner(menu));
}
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_config.h » ('j') | ui/views/controls/menu/menu_item_view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698