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

Side by Side Diff: ash/display/mouse_cursor_event_filter.cc

Issue 296053005: Fix more cases of unreachable code on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « no previous file | chrome/browser/extensions/extension_apitest.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 "ash/display/mouse_cursor_event_filter.h" 5 #include "ash/display/mouse_cursor_event_filter.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "ash/display/cursor_window_controller.h" 9 #include "ash/display/cursor_window_controller.h"
10 #include "ash/display/display_controller.h" 10 #include "ash/display/display_controller.h"
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 aura::Window** dst_root) { 462 aura::Window** dst_root) {
463 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); 463 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
464 *src_root = drag_source_root_ ? drag_source_root_ 464 *src_root = drag_source_root_ ? drag_source_root_
465 : Shell::GetInstance()->GetPrimaryRootWindow(); 465 : Shell::GetInstance()->GetPrimaryRootWindow();
466 *dst_root = root_windows[0] == *src_root ? root_windows[1] : root_windows[0]; 466 *dst_root = root_windows[0] == *src_root ? root_windows[1] : root_windows[0];
467 } 467 }
468 468
469 bool MouseCursorEventFilter::WarpMouseCursorIfNecessaryForTest( 469 bool MouseCursorEventFilter::WarpMouseCursorIfNecessaryForTest(
470 aura::Window* target_root, 470 aura::Window* target_root,
471 const gfx::Point& point_in_screen) { 471 const gfx::Point& point_in_screen) {
472 if (enable_mouse_warp_in_native_coords) { 472 if (!enable_mouse_warp_in_native_coords)
473 gfx::Point native = point_in_screen;
474 wm::ConvertPointFromScreen(target_root, &native);
475 target_root->GetHost()->ConvertPointToNativeScreen(&native);
476 return WarpMouseCursorInNativeCoords(native, point_in_screen);
477 } else {
478 return WarpMouseCursorInScreenCoords(target_root, point_in_screen); 473 return WarpMouseCursorInScreenCoords(target_root, point_in_screen);
479 } 474 gfx::Point native = point_in_screen;
480 return true; 475 wm::ConvertPointFromScreen(target_root, &native);
476 target_root->GetHost()->ConvertPointToNativeScreen(&native);
477 return WarpMouseCursorInNativeCoords(native, point_in_screen);
481 } 478 }
482 479
483 } // namespace ash 480 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698