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

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

Issue 267593005: Refactor menu controller to isolate aura dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes for sky Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/controls/menu/menu_message_loop.h » ('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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 69
70 void MenuHost::ShowMenuHost(bool do_capture) { 70 void MenuHost::ShowMenuHost(bool do_capture) {
71 // Doing a capture may make us get capture lost. Ignore it while we're in the 71 // Doing a capture may make us get capture lost. Ignore it while we're in the
72 // process of showing. 72 // process of showing.
73 base::AutoReset<bool> reseter(&ignore_capture_lost_, true); 73 base::AutoReset<bool> reseter(&ignore_capture_lost_, true);
74 ShowInactive(); 74 ShowInactive();
75 if (do_capture) { 75 if (do_capture) {
76 // Cancel existing touches, so we don't miss some touch release/cancel 76 // Cancel existing touches, so we don't miss some touch release/cancel
77 // events due to the menu taking capture. 77 // events due to the menu taking capture.
78 ui::GestureRecognizer::Get()->TransferEventsTo(GetNativeWindow(), NULL); 78 ui::GestureRecognizer::Get()->TransferEventsTo(NULL, NULL);
79 native_widget_private()->SetCapture(); 79 native_widget_private()->SetCapture();
80 } 80 }
81 } 81 }
82 82
83 void MenuHost::HideMenuHost() { 83 void MenuHost::HideMenuHost() {
84 ignore_capture_lost_ = true; 84 ignore_capture_lost_ = true;
85 ReleaseMenuHostCapture(); 85 ReleaseMenuHostCapture();
86 Hide(); 86 Hide();
87 ignore_capture_lost_ = false; 87 ignore_capture_lost_ = false;
88 } 88 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (destroying_) 134 if (destroying_)
135 return; 135 return;
136 136
137 MenuController* menu_controller = 137 MenuController* menu_controller =
138 submenu_->GetMenuItem()->GetMenuController(); 138 submenu_->GetMenuItem()->GetMenuController();
139 if (menu_controller && !menu_controller->drag_in_progress()) 139 if (menu_controller && !menu_controller->drag_in_progress())
140 menu_controller->CancelAll(); 140 menu_controller->CancelAll();
141 } 141 }
142 142
143 } // namespace views 143 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/controls/menu/menu_message_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698