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

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

Issue 22865036: Add support for reposting the ET_GESTURE_TAP_DOWN gesture event to the RootWindow and in the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 4 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_controller.h" 5 #include "ui/views/controls/menu/menu_controller.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windowsx.h> 8 #include <windowsx.h>
9 #endif 9 #endif
10 10
(...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 event_type = 0; // Unknown mouse press. 2117 event_type = 0; // Unknown mouse press.
2118 2118
2119 if (event_type) { 2119 if (event_type) {
2120 if (in_client_area) { 2120 if (in_client_area) {
2121 PostMessage(window, event_type, event.native_event().wParam, 2121 PostMessage(window, event_type, event.native_event().wParam,
2122 MAKELPARAM(window_x, window_y)); 2122 MAKELPARAM(window_x, window_y));
2123 } else { 2123 } else {
2124 PostMessage(window, event_type, nc_hit_result, 2124 PostMessage(window, event_type, nc_hit_result,
2125 MAKELPARAM(screen_loc.x(), screen_loc.y())); 2125 MAKELPARAM(screen_loc.x(), screen_loc.y()));
2126 } 2126 }
2127 } else if (event.type() == ui::ET_GESTURE_TAP_DOWN) {
2128 // Gesture events need to be posted to the target root window. In
2129 // desktop chrome there could be multiple root windows.
2130 aura::RootWindow* target_root =
2131 aura::RootWindow::GetForAcceleratedWidget(window);
2132 if (target_root) {
sky 2013/08/22 22:07:16 nit: no {}
ananta 2013/08/22 22:48:15 Done.
2133 target_root->RepostEvent(event);
2134 }
2127 } 2135 }
2128 } 2136 }
2129 } 2137 }
2130 #elif defined(USE_AURA) 2138 #elif defined(USE_AURA)
2131 void MenuController::RepostEvent(SubmenuView* source, 2139 void MenuController::RepostEvent(SubmenuView* source,
2132 const ui::LocatedEvent& event) { 2140 const ui::LocatedEvent& event) {
2133 aura::RootWindow* root_window = 2141 aura::RootWindow* root_window =
2134 source->GetWidget()->GetNativeWindow()->GetRootWindow(); 2142 source->GetWidget()->GetNativeWindow()->GetRootWindow();
2135 DCHECK(root_window); 2143 DCHECK(root_window);
2136 root_window->RepostEvent(event); 2144 root_window->RepostEvent(event);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 (!pending_state_.item->HasSubmenu() || 2297 (!pending_state_.item->HasSubmenu() ||
2290 !pending_state_.item->GetSubmenu()->IsShowing())) { 2298 !pending_state_.item->GetSubmenu()->IsShowing())) {
2291 // On exit if the user hasn't selected an item with a submenu, move the 2299 // On exit if the user hasn't selected an item with a submenu, move the
2292 // selection back to the parent menu item. 2300 // selection back to the parent menu item.
2293 SetSelection(pending_state_.item->GetParentMenuItem(), 2301 SetSelection(pending_state_.item->GetParentMenuItem(),
2294 SELECTION_OPEN_SUBMENU); 2302 SELECTION_OPEN_SUBMENU);
2295 } 2303 }
2296 } 2304 }
2297 2305
2298 } // namespace views 2306 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698