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

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

Issue 2978833002: Making CursorFactoryOzone thread-local (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | ui/base/cursor/cursor_loader_ozone.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 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_OZONE_H_ 5 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_OZONE_H_
6 #define UI_BASE_CURSOR_CURSOR_LOADER_OZONE_H_ 6 #define UI_BASE_CURSOR_CURSOR_LOADER_OZONE_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "ui/base/cursor/cursor.h" 11 #include "ui/base/cursor/cursor.h"
12 #include "ui/base/cursor/cursor_loader.h" 12 #include "ui/base/cursor/cursor_loader.h"
13 13
14 namespace ui { 14 namespace ui {
15 15
16 class CursorFactoryOzone;
17
16 class UI_BASE_EXPORT CursorLoaderOzone : public CursorLoader { 18 class UI_BASE_EXPORT CursorLoaderOzone : public CursorLoader {
17 public: 19 public:
20 // CursorLoaderOzone will use CursorFactoryOzone corresponding to the thread
21 // it was constructed on.
18 CursorLoaderOzone(); 22 CursorLoaderOzone();
19 ~CursorLoaderOzone() override; 23 ~CursorLoaderOzone() override;
20 24
21 // CursorLoader overrides: 25 // CursorLoader overrides:
22 void LoadImageCursor(CursorType id, 26 void LoadImageCursor(CursorType id,
23 int resource_id, 27 int resource_id,
24 const gfx::Point& hot) override; 28 const gfx::Point& hot) override;
25 void LoadAnimatedCursor(CursorType id, 29 void LoadAnimatedCursor(CursorType id,
26 int resource_id, 30 int resource_id,
27 const gfx::Point& hot, 31 const gfx::Point& hot,
28 int frame_delay_ms) override; 32 int frame_delay_ms) override;
29 void UnloadAll() override; 33 void UnloadAll() override;
30 void SetPlatformCursor(gfx::NativeCursor* cursor) override; 34 void SetPlatformCursor(gfx::NativeCursor* cursor) override;
31 35
32 private: 36 private:
33 // Pointers are owned by ResourceBundle and must not be freed here. 37 // Pointers are owned by ResourceBundle and must not be freed here.
34 typedef std::map<CursorType, PlatformCursor> ImageCursorMap; 38 typedef std::map<CursorType, PlatformCursor> ImageCursorMap;
35 ImageCursorMap cursors_; 39 ImageCursorMap cursors_;
40 CursorFactoryOzone* factory_ = nullptr;
36 41
37 DISALLOW_COPY_AND_ASSIGN(CursorLoaderOzone); 42 DISALLOW_COPY_AND_ASSIGN(CursorLoaderOzone);
38 }; 43 };
39 44
40 } // namespace ui 45 } // namespace ui
41 46
42 #endif // UI_BASE_CURSOR_CURSOR_LOADER_OZONE_H_ 47 #endif // UI_BASE_CURSOR_CURSOR_LOADER_OZONE_H_
OLDNEW
« no previous file with comments | « no previous file | ui/base/cursor/cursor_loader_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698