diff options
author | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-15 21:31:41 +0000 |
---|---|---|
committer | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-15 21:31:41 +0000 |
commit | 3f847b4a2a6defcd9f9572d4a38046997bdbc30a (patch) | |
tree | fd6a6674128724ad69e084ebd41dc9e87924bedb /views | |
parent | 9ba318d32ec3da89dff428ce9f6384e7d2122034 (diff) | |
download | chromium_src-3f847b4a2a6defcd9f9572d4a38046997bdbc30a.zip chromium_src-3f847b4a2a6defcd9f9572d4a38046997bdbc30a.tar.gz chromium_src-3f847b4a2a6defcd9f9572d4a38046997bdbc30a.tar.bz2 |
Make windows menu accelerators work in owner-draw mode.
For items added to context menus by extensions, we display the extension's
icon next to the top-level item. To display this icon, we use owner-draw
mode, and it turns out that our code was assuming that we didn't
need to tell windows about the labels of items in owner-draw mode.
BUG=54497
TEST=Steps are outlined in the bug. Also all things menu related should be
tested on windows.(wrench menu, context menus in web content, bookmark bar
items, browser actions, etc.)
Review URL: http://codereview.chromium.org/3402005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/menu/native_menu_win.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/views/controls/menu/native_menu_win.cc b/views/controls/menu/native_menu_win.cc index 665b15e..a482870 100644 --- a/views/controls/menu/native_menu_win.cc +++ b/views/controls/menu/native_menu_win.cc @@ -542,8 +542,7 @@ void NativeMenuWin::SetMenuItemLabel(int menu_index, MENUITEMINFO mii = {0}; mii.cbSize = sizeof(mii); UpdateMenuItemInfoForString(&mii, model_index, label); - if (!owner_draw_) - SetMenuItemInfo(menu_, menu_index, MF_BYPOSITION, &mii); + SetMenuItemInfo(menu_, menu_index, MF_BYPOSITION, &mii); } void NativeMenuWin::UpdateMenuItemInfoForString( @@ -565,13 +564,10 @@ void NativeMenuWin::UpdateMenuItemInfoForString( // version around. items_[model_index]->label = formatted; - // Windows only requires a pointer to the label string if it's going to be - // doing the drawing. - if (!owner_draw_) { - mii->fMask |= MIIM_STRING; - mii->dwTypeData = - const_cast<wchar_t*>(items_.at(model_index)->label.c_str()); - } + // Give Windows a pointer to the label string. + mii->fMask |= MIIM_STRING; + mii->dwTypeData = + const_cast<wchar_t*>(items_.at(model_index)->label.c_str()); } UINT NativeMenuWin::GetAlignmentFlags(int alignment) const { |