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

Side by Side Diff: ui/views/controls/menu/menu_host.cc

Issue 118283003: Make Widget::Show() creates active windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more ShowInactive() calls Created 6 years, 11 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/status_bubble_views.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/menu/menu_host.h" 5 #include "ui/views/controls/menu/menu_host.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "ui/events/gestures/gesture_recognizer.h" 9 #include "ui/events/gestures/gesture_recognizer.h"
10 #include "ui/gfx/path.h" 10 #include "ui/gfx/path.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 bool MenuHost::IsMenuHostVisible() { 71 bool MenuHost::IsMenuHostVisible() {
72 return IsVisible(); 72 return IsVisible();
73 } 73 }
74 74
75 void MenuHost::ShowMenuHost(bool do_capture) { 75 void MenuHost::ShowMenuHost(bool do_capture) {
76 // Doing a capture may make us get capture lost. Ignore it while we're in the 76 // Doing a capture may make us get capture lost. Ignore it while we're in the
77 // process of showing. 77 // process of showing.
78 base::AutoReset<bool> reseter(&ignore_capture_lost_, true); 78 base::AutoReset<bool> reseter(&ignore_capture_lost_, true);
79 Show(); 79 ShowInactive();
80 if (do_capture) { 80 if (do_capture) {
81 #if defined(USE_AURA) 81 #if defined(USE_AURA)
82 // Cancel existing touches, so we don't miss some touch release/cancel 82 // Cancel existing touches, so we don't miss some touch release/cancel
83 // events due to the menu taking capture. 83 // events due to the menu taking capture.
84 ui::GestureRecognizer::Get()->TransferEventsTo(GetNativeWindow(), NULL); 84 ui::GestureRecognizer::Get()->TransferEventsTo(GetNativeWindow(), NULL);
85 #endif // USE_AURA 85 #endif // USE_AURA
86 native_widget_private()->SetCapture(); 86 native_widget_private()->SetCapture();
87 } 87 }
88 } 88 }
89 89
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 if (destroying_) 141 if (destroying_)
142 return; 142 return;
143 143
144 MenuController* menu_controller = 144 MenuController* menu_controller =
145 submenu_->GetMenuItem()->GetMenuController(); 145 submenu_->GetMenuItem()->GetMenuController();
146 if (menu_controller && !menu_controller->drag_in_progress()) 146 if (menu_controller && !menu_controller->drag_in_progress())
147 menu_controller->CancelAll(); 147 menu_controller->CancelAll();
148 } 148 }
149 149
150 } // namespace views 150 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/status_bubble_views.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698