summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-28 12:42:08 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-28 12:42:08 +0000
commit8206655a8784dc37ff2d67dcc5db8c4c29923ba1 (patch)
tree42fd2ddcbf708d7adb42da91d7a9efca9649e8c4
parent4b6c5f721ef20ad68bbba2b9fca3d20393482bbf (diff)
downloadchromium_src-8206655a8784dc37ff2d67dcc5db8c4c29923ba1.zip
chromium_src-8206655a8784dc37ff2d67dcc5db8c4c29923ba1.tar.gz
chromium_src-8206655a8784dc37ff2d67dcc5db8c4c29923ba1.tar.bz2
Hide the wrench menu without fade out when "Report Issue" is clicked.
BUG=114241 TEST=manually Review URL: http://codereview.chromium.org/9423036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123964 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/wrench_menu.cc20
-rw-r--r--chrome/browser/ui/views/wrench_menu.h6
2 files changed, 25 insertions, 1 deletions
diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc
index 47f1cfd..9a69649 100644
--- a/chrome/browser/ui/views/wrench_menu.cc
+++ b/chrome/browser/ui/views/wrench_menu.cc
@@ -578,6 +578,7 @@ WrenchMenu::WrenchMenu(Browser* browser)
selected_menu_model_(NULL),
selected_index_(0),
bookmark_menu_(NULL),
+ feedback_menu_item_(NULL),
first_bookmark_command_id_(0) {
registrar_.Add(this, chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED,
content::Source<Profile>(browser_->profile()));
@@ -781,6 +782,20 @@ void WrenchMenu::WillShowMenu(MenuItemView* menu) {
CreateBookmarkMenu();
}
+void WrenchMenu::WillHideMenu(MenuItemView* menu) {
+ // Turns off the fade out animation of the wrench menus if
+ // |feedback_menu_item_| is selected. This excludes the wrench menu itself
+ // from the snapshot in the feedback UI.
+ if (menu->HasSubmenu() && feedback_menu_item_ &&
+ feedback_menu_item_->IsSelected()) {
+ // It's okay to just turn off the animation and no to take care the
+ // animation back because the menu widget will be recreated next time
+ // it's opened. See ToolbarView::RunMenu() and Init() of this class.
+ menu->GetSubmenu()->GetWidget()->
+ SetVisibilityChangedAnimationsEnabled(false);
+ }
+}
+
void WrenchMenu::BookmarkModelChanged() {
DCHECK(bookmark_menu_delegate_.get());
if (!bookmark_menu_delegate_->is_mutating_model())
@@ -842,6 +857,11 @@ void WrenchMenu::PopulateMenu(MenuItemView* parent,
bookmark_menu_ = item;
break;
+ case IDC_FEEDBACK:
+ DCHECK(!feedback_menu_item_);
+ feedback_menu_item_ = item;
+ break;
+
default:
break;
}
diff --git a/chrome/browser/ui/views/wrench_menu.h b/chrome/browser/ui/views/wrench_menu.h
index 3ee0c58a1..ad5ea3f 100644
--- a/chrome/browser/ui/views/wrench_menu.h
+++ b/chrome/browser/ui/views/wrench_menu.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -70,6 +70,7 @@ class WrenchMenu : public views::MenuDelegate,
virtual void ExecuteCommand(int id, int mouse_event_flags) OVERRIDE;
virtual bool GetAccelerator(int id, ui::Accelerator* accelerator) OVERRIDE;
virtual void WillShowMenu(views::MenuItemView* menu) OVERRIDE;
+ virtual void WillHideMenu(views::MenuItemView* menu) OVERRIDE;
// BaseBookmarkModelObserver overrides:
virtual void BookmarkModelChanged() OVERRIDE;
@@ -139,6 +140,9 @@ class WrenchMenu : public views::MenuDelegate,
// Menu corresponding to IDC_BOOKMARKS_MENU.
views::MenuItemView* bookmark_menu_;
+ // Menu corresponding to IDC_FEEDBACK.
+ views::MenuItemView* feedback_menu_item_;
+
// ID to use for the items representing bookmarks in the bookmark menu.
int first_bookmark_command_id_;