diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-28 19:41:18 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-28 19:41:18 +0000 |
commit | c1edf2958e6b67b7fc083658d5fc73e0dc59b20f (patch) | |
tree | 5ac48bd872b736d5d3891c0d78ecb17b2f266bf0 | |
parent | 5f19c31ad9c77999347616d9b47539de50373e0c (diff) | |
download | chromium_src-c1edf2958e6b67b7fc083658d5fc73e0dc59b20f.zip chromium_src-c1edf2958e6b67b7fc083658d5fc73e0dc59b20f.tar.gz chromium_src-c1edf2958e6b67b7fc083658d5fc73e0dc59b20f.tar.bz2 |
Fixes new wrench menu on chromeos.
BUG=none
TEST=none
TBR=oshima@chromium.org
Review URL: http://codereview.chromium.org/2812028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51021 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/status/browser_status_area_view.cc | 19 | ||||
-rw-r--r-- | chrome/browser/chromeos/status/browser_status_area_view.h | 7 |
2 files changed, 12 insertions, 14 deletions
diff --git a/chrome/browser/chromeos/status/browser_status_area_view.cc b/chrome/browser/chromeos/status/browser_status_area_view.cc index 9518fc1..2e0e867 100644 --- a/chrome/browser/chromeos/status/browser_status_area_view.cc +++ b/chrome/browser/chromeos/status/browser_status_area_view.cc @@ -5,6 +5,7 @@ #include "chrome/browser/chromeos/status/browser_status_area_view.h" #include "app/l10n_util.h" +#include "app/menus/simple_menu_model.h" #include "app/theme_provider.h" #include "base/string_util.h" #include "chrome/app/chrome_dll_resource.h" @@ -19,6 +20,7 @@ #include "chrome/browser/profile.h" #include "chrome/browser/views/theme_background.h" #include "chrome/browser/views/toolbar_view.h" +#include "chrome/browser/wrench_menu_model.h" #include "chrome/common/pref_names.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -112,24 +114,21 @@ void BrowserStatusAreaView::Init() { app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); } -AppMenuModel* BrowserStatusAreaView::CreateAppMenuModel( +menus::SimpleMenuModel* BrowserStatusAreaView::CreateAppMenuModel( menus::SimpleMenuModel::Delegate* delegate) { Browser* browser = browser_view_->browser(); - AppMenuModel* menu_model = new AppMenuModel(delegate, browser); + menus::SimpleMenuModel* menu_model; + + if (WrenchMenuModel::IsEnabled()) + menu_model = new WrenchMenuModel(delegate, browser); + else + menu_model = new AppMenuModel(delegate, browser); // Options menu always uses StatusAreaView as delegate, so // we can reuse it. if (!options_menu_contents_.get()) options_menu_contents_.reset(new OptionsMenuModel(browser_view_)); -#if !defined(OS_CHROMEOS) - int sync_index = menu_model->GetIndexOfCommandId(IDC_SYNC_BOOKMARKS); - DCHECK_GE(sync_index, 0); - menu_model->InsertItemWithStringIdAt( - sync_index + 1, IDC_CLEAR_BROWSING_DATA, IDS_CLEAR_BROWSING_DATA); - menu_model->InsertSeparatorAt(sync_index + 1); -#endif - int options_index = menu_model->GetIndexOfCommandId(IDC_OPTIONS); DCHECK_GE(options_index, 0); menu_model->InsertSubMenuAt( diff --git a/chrome/browser/chromeos/status/browser_status_area_view.h b/chrome/browser/chromeos/status/browser_status_area_view.h index 089eeda..5a6b0d3 100644 --- a/chrome/browser/chromeos/status/browser_status_area_view.h +++ b/chrome/browser/chromeos/status/browser_status_area_view.h @@ -12,8 +12,6 @@ #include "views/controls/menu/menu_2.h" #include "views/view.h" -class AppMenuModel; - namespace chromeos { class BrowserView; @@ -30,8 +28,9 @@ class BrowserStatusAreaView : public StatusAreaView, virtual void Init(); - // Creates an AppMenuModel for chromeos. - AppMenuModel* CreateAppMenuModel(menus::SimpleMenuModel::Delegate* delegate); + // Creates the app menu model. + menus::SimpleMenuModel* CreateAppMenuModel( + menus::SimpleMenuModel::Delegate* delegate); StatusAreaButton* menu_view() const { return menu_view_; } |