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

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

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: . Created 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/event_transformation_handler.h" 5 #include "ash/display/event_transformation_handler.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "ash/display/display_info.h" 9 #include "ash/display/display_info.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
oshima 2016/01/20 06:40:12 nit: can we remove this now?
scottmg 2016/01/26 20:46:35 Done.
12 #include "ash/wm/window_util.h" 12 #include "ash/wm/window_util.h"
13 #include "ui/aura/window.h" 13 #include "ui/aura/window.h"
14 #include "ui/aura/window_event_dispatcher.h" 14 #include "ui/aura/window_event_dispatcher.h"
15 #include "ui/compositor/dip_util.h" 15 #include "ui/compositor/dip_util.h"
16 #include "ui/events/event.h" 16 #include "ui/events/event.h"
17 #include "ui/gfx/display.h" 17 #include "ui/gfx/display.h"
18 #include "ui/gfx/screen.h" 18 #include "ui/gfx/screen.h"
19 #include "ui/wm/core/coordinate_conversion.h" 19 #include "ui/wm/core/coordinate_conversion.h"
20 20
21 namespace ash { 21 namespace ash {
(...skipping 14 matching lines...) Expand all
36 void EventTransformationHandler::OnScrollEvent(ui::ScrollEvent* event) { 36 void EventTransformationHandler::OnScrollEvent(ui::ScrollEvent* event) {
37 if (transformation_mode_ == TRANSFORM_NONE) 37 if (transformation_mode_ == TRANSFORM_NONE)
38 return; 38 return;
39 39
40 // It is unnecessary to scale the event for the device scale factor since 40 // It is unnecessary to scale the event for the device scale factor since
41 // the event locations etc. are already in DIP. 41 // the event locations etc. are already in DIP.
42 gfx::Point point_in_screen(event->location()); 42 gfx::Point point_in_screen(event->location());
43 aura::Window* target = static_cast<aura::Window*>(event->target()); 43 aura::Window* target = static_cast<aura::Window*>(event->target());
44 ::wm::ConvertPointToScreen(target, &point_in_screen); 44 ::wm::ConvertPointToScreen(target, &point_in_screen);
45 const gfx::Display& display = 45 const gfx::Display& display =
46 Shell::GetScreen()->GetDisplayNearestPoint(point_in_screen); 46 gfx::Screen::GetScreen()->GetDisplayNearestPoint(point_in_screen);
47 47
48 // Apply some additional scaling if the display is non-integrated. 48 // Apply some additional scaling if the display is non-integrated.
49 if (!display.IsInternal()) 49 if (!display.IsInternal())
50 event->Scale(kBoostForNonIntegrated); 50 event->Scale(kBoostForNonIntegrated);
51 } 51 }
52 52
53 } // namespace ash 53 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698