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

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

Issue 10919135: Move ash specific cursor code to CursorManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests and rebase Created 8 years, 3 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_H_
6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_
7
8 #include "base/logging.h"
9 #include "ui/base/ui_export.h"
10 #include "ui/gfx/native_widget_types.h"
11 #include "ui/gfx/point.h"
12
13 namespace ui {
14
15 class UI_EXPORT CursorLoader {
16 public:
17 CursorLoader() : device_scale_factor_(0.0f) {}
18 virtual ~CursorLoader() {};
sky 2012/09/10 22:49:06 no ;
mazda 2012/09/11 00:45:09 Done.
19
20 // Returns the device scale factor used by the loader.
21 float device_scale_factor() const {
22 return device_scale_factor_;
23 }
24
25 // Sets the device scale factor used by the loader.
26 void set_device_scale_factor(float device_scale_factor) {
27 device_scale_factor_ = device_scale_factor;
28 }
29
30 // Creates a cursor from an image resource and puts it in the cursor map.
31 virtual void LoadImageCursor(
32 int id, int resource_id, const gfx::Point& hot) = 0;
sky 2012/09/10 22:49:06 each param on its own line here and 40
mazda 2012/09/11 00:45:09 Done.
33
34 // Creates an animated cursor from an image resource and puts it in the
35 // cursor map. The image is assumed to be a concatenation of animation frames
36 // from left to right. Also, each frame is assumed to be square
37 // (width == height).
38 // |frame_delay_ms| is the delay between frames in millisecond.
39 virtual void LoadAnimatedCursor(
40 int id, int resource_id, const gfx::Point& hot, int frame_delay_ms) = 0;
41
42 // Unloads all the cursors.
43 virtual void UnloadAll() = 0;
44
45 // Sets the platform cursor based on the native type of |cursor|.
46 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0;
47
48 // Creates a CursorLoader.
49 static CursorLoader* Create();
50
51 private:
52 // The device scale factor used by the loader.
53 float device_scale_factor_;
54 };
55
56 } // namespace ui
57
58 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698