Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: views/controls/menu/menu_host.cc

Issue 7390032: Fixes regression from menu refactoring. The old windows code wasn't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename field Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/menu/menu_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/menu_host.cc
diff --git a/views/controls/menu/menu_host.cc b/views/controls/menu/menu_host.cc
index b767febe828c69316e42e0882c882514ac4e7d76..f43800dc732a0a92d872da304fc6e9cbed1f568f 100644
--- a/views/controls/menu/menu_host.cc
+++ b/views/controls/menu/menu_host.cc
@@ -20,7 +20,7 @@ namespace views {
MenuHost::MenuHost(SubmenuView* submenu)
: submenu_(submenu),
destroying_(false),
- showing_(false) {
+ ignore_capture_lost_(false) {
}
MenuHost::~MenuHost() {
@@ -50,7 +50,7 @@ bool MenuHost::IsMenuHostVisible() {
void MenuHost::ShowMenuHost(bool do_capture) {
// Doing a capture may make us get capture lost. Ignore it while we're in the
// process of showing.
- showing_ = true;
+ ignore_capture_lost_ = true;
Show();
if (do_capture) {
native_widget_private()->SetMouseCapture();
@@ -59,12 +59,14 @@ void MenuHost::ShowMenuHost(bool do_capture) {
// become active and confuse things.
native_widget_private()->SetKeyboardCapture();
}
- showing_ = false;
+ ignore_capture_lost_ = false;
}
void MenuHost::HideMenuHost() {
+ ignore_capture_lost_ = true;
ReleaseMenuHostCapture();
Hide();
+ ignore_capture_lost_ = false;
}
void MenuHost::DestroyMenuHost() {
@@ -97,7 +99,7 @@ bool MenuHost::ShouldReleaseCaptureOnMouseReleased() const {
}
void MenuHost::OnMouseCaptureLost() {
- if (destroying_ || showing_)
+ if (destroying_ || ignore_capture_lost_)
return;
MenuController* menu_controller =
submenu_->GetMenuItem()->GetMenuController();
« no previous file with comments | « views/controls/menu/menu_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698