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

Side by Side Diff: ui/gfx/screen_mac.mm

Issue 672823002: Remove IsDIPEnabled from Screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dpi-cleanup-1
Patch Set: rebase Created 6 years, 1 month 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 | « ui/gfx/screen_ios.mm ('k') | ui/gfx/screen_win.h » ('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 "ui/gfx/screen.h" 5 #include "ui/gfx/screen.h"
6 6
7 #import <ApplicationServices/ApplicationServices.h> 7 #import <ApplicationServices/ApplicationServices.h>
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 class ScreenMac : public gfx::Screen { 85 class ScreenMac : public gfx::Screen {
86 public: 86 public:
87 ScreenMac() { 87 ScreenMac() {
88 displays_ = BuildDisplaysFromQuartz(); 88 displays_ = BuildDisplaysFromQuartz();
89 89
90 CGDisplayRegisterReconfigurationCallback( 90 CGDisplayRegisterReconfigurationCallback(
91 ScreenMac::DisplayReconfigurationCallBack, this); 91 ScreenMac::DisplayReconfigurationCallBack, this);
92 } 92 }
93 93
94 bool IsDIPEnabled() override { return true; }
95
96 gfx::Point GetCursorScreenPoint() override { 94 gfx::Point GetCursorScreenPoint() override {
97 NSPoint mouseLocation = [NSEvent mouseLocation]; 95 NSPoint mouseLocation = [NSEvent mouseLocation];
98 // Flip coordinates to gfx (0,0 in top-left corner) using primary screen. 96 // Flip coordinates to gfx (0,0 in top-left corner) using primary screen.
99 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 97 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
100 mouseLocation.y = NSMaxY([screen frame]) - mouseLocation.y; 98 mouseLocation.y = NSMaxY([screen frame]) - mouseLocation.y;
101 return gfx::Point(mouseLocation.x, mouseLocation.y); 99 return gfx::Point(mouseLocation.x, mouseLocation.y);
102 } 100 }
103 101
104 gfx::NativeWindow GetWindowUnderCursor() override { 102 gfx::NativeWindow GetWindowUnderCursor() override {
105 NOTIMPLEMENTED(); 103 NOTIMPLEMENTED();
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 264
267 namespace gfx { 265 namespace gfx {
268 266
269 #if !defined(USE_AURA) 267 #if !defined(USE_AURA)
270 Screen* CreateNativeScreen() { 268 Screen* CreateNativeScreen() {
271 return new ScreenMac; 269 return new ScreenMac;
272 } 270 }
273 #endif 271 #endif
274 272
275 } 273 }
OLDNEW
« no previous file with comments | « ui/gfx/screen_ios.mm ('k') | ui/gfx/screen_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698