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

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

Issue 249113002: MacViews: Adds NativeWidgetMac and gets views target compiling on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
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"
tapted 2014/05/21 09:40:29 would need to guard this too (but that breaks appl
10 #include "ui/gfx/path.h" 10 #include "ui/gfx/path.h"
11 #include "ui/native_theme/native_theme.h" 11 #include "ui/native_theme/native_theme.h"
12 #include "ui/views/controls/menu/menu_controller.h" 12 #include "ui/views/controls/menu/menu_controller.h"
13 #include "ui/views/controls/menu/menu_host_root_view.h" 13 #include "ui/views/controls/menu/menu_host_root_view.h"
14 #include "ui/views/controls/menu/menu_item_view.h" 14 #include "ui/views/controls/menu/menu_item_view.h"
15 #include "ui/views/controls/menu/menu_scroll_view_container.h" 15 #include "ui/views/controls/menu/menu_scroll_view_container.h"
16 #include "ui/views/controls/menu/submenu_view.h" 16 #include "ui/views/controls/menu/submenu_view.h"
17 #include "ui/views/round_rect_painter.h" 17 #include "ui/views/round_rect_painter.h"
18 #include "ui/views/widget/native_widget_private.h" 18 #include "ui/views/widget/native_widget_private.h"
19 #include "ui/views/widget/widget.h" 19 #include "ui/views/widget/widget.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 void MenuHost::ShowMenuHost(bool do_capture) { 67 void MenuHost::ShowMenuHost(bool do_capture) {
68 // Doing a capture may make us get capture lost. Ignore it while we're in the 68 // Doing a capture may make us get capture lost. Ignore it while we're in the
69 // process of showing. 69 // process of showing.
70 base::AutoReset<bool> reseter(&ignore_capture_lost_, true); 70 base::AutoReset<bool> reseter(&ignore_capture_lost_, true);
71 ShowInactive(); 71 ShowInactive();
72 if (do_capture) { 72 if (do_capture) {
73 // Cancel existing touches, so we don't miss some touch release/cancel 73 // Cancel existing touches, so we don't miss some touch release/cancel
74 // events due to the menu taking capture. 74 // events due to the menu taking capture.
75 #ifdef USE_AURA
75 ui::GestureRecognizer::Get()->TransferEventsTo(NULL, NULL); 76 ui::GestureRecognizer::Get()->TransferEventsTo(NULL, NULL);
77 #endif
tapted 2014/05/21 09:40:29 This is to resolve Undefined symbols for architec
Andre 2014/05/21 17:13:31 That symbol was defined the last time I tried to b
tapted 2014/05/22 12:50:14 I poked at this a bit. Tried out just compiling th
76 native_widget_private()->SetCapture(); 78 native_widget_private()->SetCapture();
77 } 79 }
78 } 80 }
79 81
80 void MenuHost::HideMenuHost() { 82 void MenuHost::HideMenuHost() {
81 ignore_capture_lost_ = true; 83 ignore_capture_lost_ = true;
82 ReleaseMenuHostCapture(); 84 ReleaseMenuHostCapture();
83 Hide(); 85 Hide();
84 ignore_capture_lost_ = false; 86 ignore_capture_lost_ = false;
85 } 87 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (destroying_) 133 if (destroying_)
132 return; 134 return;
133 135
134 MenuController* menu_controller = 136 MenuController* menu_controller =
135 submenu_->GetMenuItem()->GetMenuController(); 137 submenu_->GetMenuItem()->GetMenuController();
136 if (menu_controller && !menu_controller->drag_in_progress()) 138 if (menu_controller && !menu_controller->drag_in_progress())
137 menu_controller->CancelAll(); 139 menu_controller->CancelAll();
138 } 140 }
139 141
140 } // namespace views 142 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698