diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-04 17:50:26 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-04 17:50:26 +0000 |
commit | b284843ba6a1e90c12f91eaf796726433dc2537d (patch) | |
tree | 96edc5a4528e4d685c89544bfc13712e2984964a /views/controls/menu/native_menu_win.cc | |
parent | e83ce1e3f2fcacb3d400287d78567d22a2a06cae (diff) | |
download | chromium_src-b284843ba6a1e90c12f91eaf796726433dc2537d.zip chromium_src-b284843ba6a1e90c12f91eaf796726433dc2537d.tar.gz chromium_src-b284843ba6a1e90c12f91eaf796726433dc2537d.tar.bz2 |
Refactor the menu model to live outside views/ so it can be shared
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/465005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu/native_menu_win.cc')
-rw-r--r-- | views/controls/menu/native_menu_win.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/views/controls/menu/native_menu_win.cc b/views/controls/menu/native_menu_win.cc index 0af8a9af..9553b73 100644 --- a/views/controls/menu/native_menu_win.cc +++ b/views/controls/menu/native_menu_win.cc @@ -122,7 +122,7 @@ class NativeMenuWin::MenuHostWindow { // Called when the user selects a specific item. void OnMenuCommand(int position, HMENU menu) { NativeMenuWin* intergoat = GetNativeMenuWinFromHMENU(menu); - Menu2Model* model = intergoat->model_; + menus::MenuModel* model = intergoat->model_; model->ActivatedAt(position); } @@ -300,7 +300,7 @@ const wchar_t* NativeMenuWin::MenuHostWindow::kMenuHostWindowKey = //////////////////////////////////////////////////////////////////////////////// // NativeMenuWin, public: -NativeMenuWin::NativeMenuWin(Menu2Model* model, HWND system_menu_for) +NativeMenuWin::NativeMenuWin(menus::MenuModel* model, HWND system_menu_for) : model_(model), menu_(NULL), owner_draw_(l10n_util::NeedOverrideDefaultUIFont(NULL, NULL) && @@ -339,7 +339,7 @@ void NativeMenuWin::Rebuild() { for (int menu_index = first_item_index_; menu_index < first_item_index_ + model_->GetItemCount(); ++menu_index) { int model_index = menu_index - first_item_index_; - if (model_->GetTypeAt(model_index) == Menu2Model::TYPE_SEPARATOR) + if (model_->GetTypeAt(model_index) == menus::MenuModel::TYPE_SEPARATOR) AddSeparatorItemAt(menu_index, model_index); else AddMenuItemAt(menu_index, model_index); @@ -390,13 +390,13 @@ void NativeMenuWin::AddMenuItemAt(int menu_index, int model_index) { ItemData* item_data = new ItemData; item_data->label = std::wstring(); - Menu2Model::ItemType type = model_->GetTypeAt(model_index); - if (type == Menu2Model::TYPE_SUBMENU) { + menus::MenuModel::ItemType type = model_->GetTypeAt(model_index); + if (type == menus::MenuModel::TYPE_SUBMENU) { item_data->submenu.reset(new Menu2(model_->GetSubmenuModelAt(model_index))); mii.fMask |= MIIM_SUBMENU; mii.hSubMenu = item_data->submenu->GetNativeMenu(); } else { - if (type == Menu2Model::TYPE_RADIO) + if (type == menus::MenuModel::TYPE_RADIO) mii.fType |= MFT_RADIOCHECK; mii.wID = model_->GetCommandIdAt(model_index); } @@ -456,8 +456,8 @@ void NativeMenuWin::UpdateMenuItemInfoForString( int model_index, const std::wstring& label) { std::wstring formatted = label; - Menu2Model::ItemType type = model_->GetTypeAt(model_index); - if (type != Menu2Model::TYPE_SUBMENU) { + menus::MenuModel::ItemType type = model_->GetTypeAt(model_index); + if (type != menus::MenuModel::TYPE_SUBMENU) { // Add accelerator details to the label if provided. views::Accelerator accelerator(base::VKEY_UNKNOWN, false, false, false); if (model_->GetAcceleratorAt(model_index, &accelerator)) { @@ -521,7 +521,7 @@ void NativeMenuWin::CreateHostWindow() { //////////////////////////////////////////////////////////////////////////////// // SystemMenuModel: -SystemMenuModel::SystemMenuModel(SimpleMenuModel::Delegate* delegate) +SystemMenuModel::SystemMenuModel(menus::SimpleMenuModel::Delegate* delegate) : SimpleMenuModel(delegate) { } |