Only fsync leveldb's directory when the manifest is being updated.
[chromium-blink-merge.git] / ash / wm / image_cursors.h
blobc01ec621fc9583948377aeda8698c11b0683d8a8
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 "base/string16.h"
11 #include "ui/gfx/native_widget_types.h"
13 namespace gfx {
14 class Display;
17 namespace ui {
18 class CursorLoader;
21 namespace ash {
23 // A utility class that provides cursors for NativeCursors for which we have
24 // image resources.
25 class ASH_EXPORT ImageCursors {
26 public:
27 ImageCursors();
28 ~ImageCursors();
30 // Returns the display the cursors are loaded for. The display must
31 // be set by SetDisplay before using this.
32 gfx::Display GetDisplay() const;
34 // Sets the display the cursors are loaded for. The device scale factor
35 // determines the size of the image to load, and the rotation of the display
36 // determines if the image and its host point has to be retated.
37 // Returns true if the cursor image is reloaded.
38 bool SetDisplay(const gfx::Display& display);
40 // Sets the scale of the mouse cursor icon.
41 void SetScale(float scale);
43 // Sets the platform cursor based on the native type of |cursor|.
44 void SetPlatformCursor(gfx::NativeCursor* cursor);
46 // Sets the cursor resource module name for non system cursors.
47 void SetCursorResourceModule(const base::string16& module_name);
49 private:
50 // Reloads the all loaded cursors in the cursor loader.
51 void ReloadCursors();
53 scoped_ptr<ui::CursorLoader> cursor_loader_;
54 float scale_;
56 DISALLOW_COPY_AND_ASSIGN(ImageCursors);
59 } // namespace ash
61 #endif // ASH_WM_IMAGE_CURSORS_H_