summaryrefslogtreecommitdiffstats
path: root/chrome/browser/wrench_menu_model.cc
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 15:44:20 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 15:44:20 +0000
commit0dad8074499c8a2784505f826505bd8862d618a1 (patch)
tree810223f3f6cdb45f9faaad7d1e713b89d2f345cc /chrome/browser/wrench_menu_model.cc
parent3eaf0ecd7a4882482d6234f7a115d1b019c13339 (diff)
downloadchromium_src-0dad8074499c8a2784505f826505bd8862d618a1.zip
chromium_src-0dad8074499c8a2784505f826505bd8862d618a1.tar.gz
chromium_src-0dad8074499c8a2784505f826505bd8862d618a1.tar.bz2
[Mac] Put buttons into the new unified Wrench menu.
This also makes changes to MenuController to support NIB-based initialization. Screen shots: http://cl.ly/1cyU (en) and http://cl.ly/1cyE (ru). BUG=47848 TEST=Click on Wrench menu and see buttons. Buttons perform their function. Review URL: http://codereview.chromium.org/2923009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/wrench_menu_model.cc')
-rw-r--r--chrome/browser/wrench_menu_model.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/wrench_menu_model.cc b/chrome/browser/wrench_menu_model.cc
index 2531280..dde128c 100644
--- a/chrome/browser/wrench_menu_model.cc
+++ b/chrome/browser/wrench_menu_model.cc
@@ -200,19 +200,23 @@ void WrenchMenuModel::Build() {
AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW);
AddSeparator();
-#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
+#if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(TOOLKIT_VIEWS))
+ // WARNING: Mac does not use the ButtonMenuItemModel, but instead defines the
+ // layout for this menu item in Toolbar.xib. It does, however, use the
+ // command_id value from AddButtonItem() to identify this special item.
edit_menu_item_model_.reset(new menus::ButtonMenuItemModel(IDS_EDIT, this));
edit_menu_item_model_->AddGroupItemWithStringId(IDC_CUT, IDS_CUT);
edit_menu_item_model_->AddGroupItemWithStringId(IDC_COPY, IDS_COPY);
edit_menu_item_model_->AddGroupItemWithStringId(IDC_PASTE, IDS_PASTE);
- AddButtonItem(0, edit_menu_item_model_.get());
+ AddButtonItem(IDC_EDIT_MENU, edit_menu_item_model_.get());
#else
// TODO(port): Move to the above.
CreateCutCopyPaste();
#endif
AddSeparator();
-#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
+#if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(TOOLKIT_VIEWS))
+ // WARNING: See above comment.
zoom_menu_item_model_.reset(
new menus::ButtonMenuItemModel(IDS_ZOOM_MENU, this));
zoom_menu_item_model_->AddGroupItemWithStringId(
@@ -224,7 +228,7 @@ void WrenchMenuModel::Build() {
zoom_menu_item_model_->AddSpace();
zoom_menu_item_model_->AddItemWithImage(
IDC_FULLSCREEN, IDR_FULLSCREEN_MENU_BUTTON);
- AddButtonItem(0, zoom_menu_item_model_.get());
+ AddButtonItem(IDC_ZOOM_MENU, zoom_menu_item_model_.get());
#else
// TODO(port): Move to the above.
CreateZoomFullscreen();