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

Side by Side Diff: ui/base/cursor/cursor_loader.h

Issue 249303002: Revert of Use platform's device scale factor for cursor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
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 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_H_ 5 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_H_
6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_ 6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "ui/base/ui_base_export.h" 10 #include "ui/base/ui_base_export.h"
11 #include "ui/gfx/display.h" 11 #include "ui/gfx/display.h"
12 #include "ui/gfx/native_widget_types.h" 12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/gfx/point.h" 13 #include "ui/gfx/point.h"
14 14
15 namespace ui { 15 namespace ui {
16 16
17 class UI_BASE_EXPORT CursorLoader { 17 class UI_BASE_EXPORT CursorLoader {
18 public: 18 public:
19 CursorLoader() : scale_(1.f) {} 19 CursorLoader() : scale_(1.f) {}
20 virtual ~CursorLoader() {} 20 virtual ~CursorLoader() {}
21 21
22 gfx::Display::Rotation rotation() const { 22 // Returns the display the loader loads images for.
23 return rotation_; 23 const gfx::Display& display() const {
24 return display_;
24 } 25 }
25 26
26 void set_rotation(gfx::Display::Rotation rotation) { 27 // Sets the display the loader loads images for.
27 rotation_ = rotation; 28 void set_display(const gfx::Display& display) {
29 display_ = display;
28 } 30 }
29 31
30 // Returns the current scale of the mouse cursor icon. 32 // Returns the current scale of the mouse cursor icon.
31 float scale() const { 33 float scale() const {
32 return scale_; 34 return scale_;
33 } 35 }
34 36
35 // Sets the scale of the mouse cursor icon. 37 // Sets the scale of the mouse cursor icon.
36 void set_scale(const float scale) { 38 void set_scale(const float scale) {
37 scale_ = scale; 39 scale_ = scale;
(...skipping 17 matching lines...) Expand all
55 // Unloads all the cursors. 57 // Unloads all the cursors.
56 virtual void UnloadAll() = 0; 58 virtual void UnloadAll() = 0;
57 59
58 // Sets the platform cursor based on the native type of |cursor|. 60 // Sets the platform cursor based on the native type of |cursor|.
59 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0; 61 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0;
60 62
61 // Creates a CursorLoader. 63 // Creates a CursorLoader.
62 static CursorLoader* Create(); 64 static CursorLoader* Create();
63 65
64 private: 66 private:
65 // The current rotation of the mouse cursor icon. 67 // The display the loader loads images for.
66 gfx::Display::Rotation rotation_; 68 gfx::Display display_;
67 69
68 // The current scale of the mouse cursor icon. 70 // The current scale of the mouse cursor icon.
69 float scale_; 71 float scale_;
70 72
71 DISALLOW_COPY_AND_ASSIGN(CursorLoader); 73 DISALLOW_COPY_AND_ASSIGN(CursorLoader);
72 }; 74 };
73 75
74 } // namespace ui 76 } // namespace ui
75 77
76 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_ 78 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc ('k') | ui/base/cursor/cursor_loader_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698