diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 16:21:32 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 16:21:32 +0000 |
commit | a00b0322403064d54f84165be0911eb81d3e44dd (patch) | |
tree | 1a792723f0c3b78686d22f5466819949e5677d1e /chrome/browser | |
parent | fefe67840b2716b2569946fcfc4a19b55c312e20 (diff) | |
download | chromium_src-a00b0322403064d54f84165be0911eb81d3e44dd.zip chromium_src-a00b0322403064d54f84165be0911eb81d3e44dd.tar.gz chromium_src-a00b0322403064d54f84165be0911eb81d3e44dd.tar.bz2 |
Changes mnemonics for bookmark menus to show the mnemonics if either
the os says we should, or focus was on the button that triggered
showing the menu. Also changes mnemonic processing to not guess at
mnemonic if menu has mnemonics.
BUG=45734
TEST=none
Review URL: http://codereview.chromium.org/2831031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/views/wrench_menu.cc | 5 | ||||
-rw-r--r-- | chrome/browser/views/wrench_menu.h | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/views/wrench_menu.cc b/chrome/browser/views/wrench_menu.cc index fa56718..2ba3a5a 100644 --- a/chrome/browser/views/wrench_menu.cc +++ b/chrome/browser/views/wrench_menu.cc @@ -25,6 +25,7 @@ #include "third_party/skia/include/core/SkPaint.h" #include "views/background.h" #include "views/controls/button/image_button.h" +#include "views/controls/button/menu_button.h" #include "views/controls/button/text_button.h" #include "views/controls/label.h" #include "views/controls/menu/menu_config.h" @@ -515,13 +516,13 @@ void WrenchMenu::Init(menus::MenuModel* model) { PopulateMenu(root_.get(), model, &next_id); } -void WrenchMenu::RunMenu(views::View* host) { +void WrenchMenu::RunMenu(views::MenuButton* host) { gfx::Point screen_loc; views::View::ConvertPointToScreen(host, &screen_loc); // Subtract 1 from the height to make the popup flush with the button border. gfx::Rect bounds(screen_loc.x(), screen_loc.y(), host->width(), host->height() - 1); - root_->RunMenuAt(host->GetWindow()->GetNativeWindow(), NULL, bounds, + root_->RunMenuAt(host->GetWindow()->GetNativeWindow(), host, bounds, MenuItemView::TOPRIGHT, true); if (selected_menu_model_) selected_menu_model_->ActivatedAt(selected_index_); diff --git a/chrome/browser/views/wrench_menu.h b/chrome/browser/views/wrench_menu.h index b371026..377dcf8 100644 --- a/chrome/browser/views/wrench_menu.h +++ b/chrome/browser/views/wrench_menu.h @@ -15,6 +15,7 @@ class Browser; namespace views { +class MenuButton; class MenuItemView; class View; } // namespace views @@ -28,7 +29,7 @@ class WrenchMenu : public views::MenuDelegate { void Init(menus::MenuModel* model); // Shows the menu relative to the specified view. - void RunMenu(views::View* host); + void RunMenu(views::MenuButton* host); // MenuDelegate overrides: virtual bool IsItemChecked(int id) const; |