summaryrefslogtreecommitdiffstats
path: root/views/controls/menu
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 19:48:58 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 19:48:58 +0000
commit9c9811cc39df633c38c01ff1eb99532a3dbed7ba (patch)
tree7b785ac06584a477410b3415ea218eed1075d3f8 /views/controls/menu
parent37832c6d285312c7ae3805835bb9eca24fce436a (diff)
downloadchromium_src-9c9811cc39df633c38c01ff1eb99532a3dbed7ba.zip
chromium_src-9c9811cc39df633c38c01ff1eb99532a3dbed7ba.tar.gz
chromium_src-9c9811cc39df633c38c01ff1eb99532a3dbed7ba.tar.bz2
Fixes bug introduced during menu refactoring. Specifically the
owner_draw_ was not getting set correctly in one case, resulting in no icons in some menus (like back/forward). BUG=http://crbug.com/12847 TEST=see bug Review URL: http://codereview.chromium.org/112096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17760 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu')
-rw-r--r--views/controls/menu/menu.h8
-rw-r--r--views/controls/menu/menu_win.cc8
-rw-r--r--views/controls/menu/menu_win.h4
3 files changed, 16 insertions, 4 deletions
diff --git a/views/controls/menu/menu.h b/views/controls/menu/menu.h
index 04da77a..faf4a7b 100644
--- a/views/controls/menu/menu.h
+++ b/views/controls/menu/menu.h
@@ -243,10 +243,10 @@ class Menu {
void AppendMenuItemWithIcon(int item_id,
const std::wstring& label,
const SkBitmap& icon);
- void AddMenuItemWithIcon(int index,
- int item_id,
- const std::wstring& label,
- const SkBitmap& icon);
+ virtual void AddMenuItemWithIcon(int index,
+ int item_id,
+ const std::wstring& label,
+ const SkBitmap& icon);
// Enables or disables the item with the specified id.
virtual void EnableMenuItemByID(int item_id, bool enabled) = 0;
diff --git a/views/controls/menu/menu_win.cc b/views/controls/menu/menu_win.cc
index 1c27d85..9067deb 100644
--- a/views/controls/menu/menu_win.cc
+++ b/views/controls/menu/menu_win.cc
@@ -265,6 +265,14 @@ MenuWin::~MenuWin() {
DestroyMenu(menu_);
}
+void MenuWin::AddMenuItemWithIcon(int index,
+ int item_id,
+ const std::wstring& label,
+ const SkBitmap& icon) {
+ owner_draw_ = true;
+ Menu::AddMenuItemWithIcon(index, item_id, label, icon);
+}
+
Menu* MenuWin::AddSubMenuWithIcon(int index,
int item_id,
const std::wstring& label,
diff --git a/views/controls/menu/menu_win.h b/views/controls/menu/menu_win.h
index bea4c65..5022db7 100644
--- a/views/controls/menu/menu_win.h
+++ b/views/controls/menu/menu_win.h
@@ -46,6 +46,10 @@ class MenuWin : public Menu {
virtual ~MenuWin();
// Menu overrides.
+ virtual void AddMenuItemWithIcon(int index,
+ int item_id,
+ const std::wstring& label,
+ const SkBitmap& icon);
virtual Menu* AddSubMenuWithIcon(int index,
int item_id,
const std::wstring& label,