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
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 @@
   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_);