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

Side by Side Diff: ui/base/cursor/image_cursors.cc

Issue 1917083002: Move gfx::Display/Screen to display::Display/Screen in ui/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « ui/base/cursor/image_cursors.h ('k') | ui/base/l10n/l10n_util_win.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/base/cursor/image_cursors.h" 5 #include "ui/base/cursor/image_cursors.h"
6 6
7 #include <float.h> 7 #include <float.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 #include "ui/base/cursor/cursor.h" 13 #include "ui/base/cursor/cursor.h"
14 #include "ui/base/cursor/cursor_loader.h" 14 #include "ui/base/cursor/cursor_loader.h"
15 #include "ui/base/cursor/cursors_aura.h" 15 #include "ui/base/cursor/cursors_aura.h"
16 #include "ui/gfx/display.h" 16 #include "ui/display/display.h"
17 #include "ui/gfx/geometry/point.h" 17 #include "ui/gfx/geometry/point.h"
18 18
19 namespace ui { 19 namespace ui {
20 20
21 namespace { 21 namespace {
22 22
23 const int kImageCursorIds[] = { 23 const int kImageCursorIds[] = {
24 kCursorNull, 24 kCursorNull,
25 kCursorPointer, 25 kCursorPointer,
26 kCursorNoDrop, 26 kCursorNoDrop,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 float ImageCursors::GetScale() const { 71 float ImageCursors::GetScale() const {
72 if (!cursor_loader_) { 72 if (!cursor_loader_) {
73 NOTREACHED(); 73 NOTREACHED();
74 // Returning default on release build as it's not serious enough to crash 74 // Returning default on release build as it's not serious enough to crash
75 // even if this ever happens. 75 // even if this ever happens.
76 return 1.0f; 76 return 1.0f;
77 } 77 }
78 return cursor_loader_->scale(); 78 return cursor_loader_->scale();
79 } 79 }
80 80
81 gfx::Display::Rotation ImageCursors::GetRotation() const { 81 display::Display::Rotation ImageCursors::GetRotation() const {
82 if (!cursor_loader_) { 82 if (!cursor_loader_) {
83 NOTREACHED(); 83 NOTREACHED();
84 // Returning default on release build as it's not serious enough to crash 84 // Returning default on release build as it's not serious enough to crash
85 // even if this ever happens. 85 // even if this ever happens.
86 return gfx::Display::ROTATE_0; 86 return display::Display::ROTATE_0;
87 } 87 }
88 return cursor_loader_->rotation(); 88 return cursor_loader_->rotation();
89 } 89 }
90 90
91 bool ImageCursors::SetDisplay(const gfx::Display& display, 91 bool ImageCursors::SetDisplay(const display::Display& display,
92 float scale_factor) { 92 float scale_factor) {
93 if (!cursor_loader_) { 93 if (!cursor_loader_) {
94 cursor_loader_.reset(CursorLoader::Create()); 94 cursor_loader_.reset(CursorLoader::Create());
95 } else if (cursor_loader_->rotation() == display.rotation() && 95 } else if (cursor_loader_->rotation() == display.rotation() &&
96 cursor_loader_->scale() == scale_factor) { 96 cursor_loader_->scale() == scale_factor) {
97 return false; 97 return false;
98 } 98 }
99 99
100 cursor_loader_->set_rotation(display.rotation()); 100 cursor_loader_->set_rotation(display.rotation());
101 cursor_loader_->set_scale(scale_factor); 101 cursor_loader_->set_scale(scale_factor);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 if (cursor_loader_.get()) 144 if (cursor_loader_.get())
145 ReloadCursors(); 145 ReloadCursors();
146 } 146 }
147 147
148 void ImageCursors::SetPlatformCursor(gfx::NativeCursor* cursor) { 148 void ImageCursors::SetPlatformCursor(gfx::NativeCursor* cursor) {
149 cursor_loader_->SetPlatformCursor(cursor); 149 cursor_loader_->SetPlatformCursor(cursor);
150 } 150 }
151 151
152 } // namespace ui 152 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/cursor/image_cursors.h ('k') | ui/base/l10n/l10n_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698