Mailbox support for texture layers.
[chromium-blink-merge.git] / ash / wm / image_cursors.h
blob61169a9a78baded617310b15b105655ea32a1487
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.
5 #ifndef ASH_WM_IMAGE_CURSORS_H_
6 #define ASH_WM_IMAGE_CURSORS_H_
8 #include "ash/ash_export.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/gfx/native_widget_types.h"
12 namespace ui {
13 class CursorLoader;
16 namespace ash {
18 // A utility class that provides cursors for NativeCursors for which we have
19 // image resources.
20 class ASH_EXPORT ImageCursors {
21 public:
22 ImageCursors();
23 ~ImageCursors();
25 // Returns the device scale factor of cursors. The device scale factor must
26 // be set by SetDeviceScaleFactor at least once before using this.
27 float GetDeviceScaleFactor() const;
29 // Sets the device scale factor of the cursors with |device_scale_factor| and
30 // reloads the cursor images if necessary. Returns true if the cursor image
31 // is reloaded.
32 bool SetDeviceScaleFactor(float device_scale_factor);
34 // Sets the platform cursor based on the native type of |cursor|.
35 void SetPlatformCursor(gfx::NativeCursor* cursor);
37 private:
38 scoped_ptr<ui::CursorLoader> cursor_loader_;
40 DISALLOW_COPY_AND_ASSIGN(ImageCursors);
43 } // namespace ash
45 #endif // ASH_WM_IMAGE_CURSORS_H_