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

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

Issue 12217120: Add IsInternal property to gfx::Display (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Get rid of static initializer Created 7 years, 10 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
« no previous file with comments | « ash/display/display_manager.cc ('k') | ash/system/chromeos/tray_display.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) 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 "ash/display/display_manager.h"
8 #include "ash/screen_ash.h" 7 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 8 #include "ash/shell.h"
10 #include "ash/wm/coordinate_conversion.h" 9 #include "ash/wm/coordinate_conversion.h"
11 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
12 #include "ui/aura/root_window.h" 11 #include "ui/aura/root_window.h"
13 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
14 #include "ui/base/events/event.h" 13 #include "ui/base/events/event.h"
15 #include "ui/compositor/dip_util.h" 14 #include "ui/compositor/dip_util.h"
16 #include "ui/gfx/display.h" 15 #include "ui/gfx/display.h"
17 #include "ui/gfx/screen.h" 16 #include "ui/gfx/screen.h"
(...skipping 20 matching lines...) Expand all
38 // Get the device scale factor and stack it on the final scale factor. 37 // Get the device scale factor and stack it on the final scale factor.
39 gfx::Point point_in_screen(event->location()); 38 gfx::Point point_in_screen(event->location());
40 aura::Window* target = static_cast<aura::Window*>(event->target()); 39 aura::Window* target = static_cast<aura::Window*>(event->target());
41 const float scale_at_target = ui::GetDeviceScaleFactor(target->layer()); 40 const float scale_at_target = ui::GetDeviceScaleFactor(target->layer());
42 float scale = scale_at_target; 41 float scale = scale_at_target;
43 42
44 // Apply some additional scaling if the display is non-integrated. 43 // Apply some additional scaling if the display is non-integrated.
45 wm::ConvertPointToScreen(target, &point_in_screen); 44 wm::ConvertPointToScreen(target, &point_in_screen);
46 const gfx::Display& display = 45 const gfx::Display& display =
47 Shell::GetScreen()->GetDisplayNearestPoint(point_in_screen); 46 Shell::GetScreen()->GetDisplayNearestPoint(point_in_screen);
48 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 47 if (!display.IsInternal())
49 if (!display_manager->IsInternalDisplayId(display.id()))
50 scale *= kBoostForNonIntegrated; 48 scale *= kBoostForNonIntegrated;
51 49
52 event->Scale(scale); 50 event->Scale(scale);
53 } 51 }
54 52
55 } // namespace internal 53 } // namespace internal
56 } // namespace ash 54 } // namespace ash
57 55
OLDNEW
« no previous file with comments | « ash/display/display_manager.cc ('k') | ash/system/chromeos/tray_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698