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

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

Issue 623293004: replace OVERRIDE and FINAL with override and final in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 6 years, 2 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 | « ui/base/cursor/cursor_loader_win.h ('k') | ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h » ('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 (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_X11_H_ 5 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_X11_H_
6 #define UI_BASE_CURSOR_CURSOR_LOADER_X11_H_ 6 #define UI_BASE_CURSOR_CURSOR_LOADER_X11_H_
7 7
8 #include <X11/Xcursor/Xcursor.h> 8 #include <X11/Xcursor/Xcursor.h>
9 #include <map> 9 #include <map>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "ui/base/cursor/cursor.h" 12 #include "ui/base/cursor/cursor.h"
13 #include "ui/base/cursor/cursor_loader.h" 13 #include "ui/base/cursor/cursor_loader.h"
14 #include "ui/base/ui_base_export.h" 14 #include "ui/base/ui_base_export.h"
15 #include "ui/base/x/x11_util.h" 15 #include "ui/base/x/x11_util.h"
16 #include "ui/gfx/display.h" 16 #include "ui/gfx/display.h"
17 17
18 namespace ui { 18 namespace ui {
19 19
20 class UI_BASE_EXPORT CursorLoaderX11 : public CursorLoader { 20 class UI_BASE_EXPORT CursorLoaderX11 : public CursorLoader {
21 public: 21 public:
22 CursorLoaderX11(); 22 CursorLoaderX11();
23 virtual ~CursorLoaderX11(); 23 virtual ~CursorLoaderX11();
24 24
25 // Overridden from CursorLoader: 25 // Overridden from CursorLoader:
26 virtual void LoadImageCursor(int id, 26 virtual void LoadImageCursor(int id,
27 int resource_id, 27 int resource_id,
28 const gfx::Point& hot) OVERRIDE; 28 const gfx::Point& hot) override;
29 virtual void LoadAnimatedCursor(int id, 29 virtual void LoadAnimatedCursor(int id,
30 int resource_id, 30 int resource_id,
31 const gfx::Point& hot, 31 const gfx::Point& hot,
32 int frame_delay_ms) OVERRIDE; 32 int frame_delay_ms) override;
33 virtual void UnloadAll() OVERRIDE; 33 virtual void UnloadAll() override;
34 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) OVERRIDE; 34 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) override;
35 35
36 const XcursorImage* GetXcursorImageForTest(int id); 36 const XcursorImage* GetXcursorImageForTest(int id);
37 37
38 private: 38 private:
39 // Returns true if we have an image resource loaded for the |native_cursor|. 39 // Returns true if we have an image resource loaded for the |native_cursor|.
40 bool IsImageCursor(gfx::NativeCursor native_cursor); 40 bool IsImageCursor(gfx::NativeCursor native_cursor);
41 41
42 // Gets the X Cursor corresponding to the |native_cursor|. 42 // Gets the X Cursor corresponding to the |native_cursor|.
43 ::Cursor ImageCursorFromNative(gfx::NativeCursor native_cursor); 43 ::Cursor ImageCursorFromNative(gfx::NativeCursor native_cursor);
44 44
45 // A map to hold all image cursors. It maps the cursor ID to the X Cursor. 45 // A map to hold all image cursors. It maps the cursor ID to the X Cursor.
46 typedef std::map<int, ::Cursor> ImageCursorMap; 46 typedef std::map<int, ::Cursor> ImageCursorMap;
47 ImageCursorMap cursors_; 47 ImageCursorMap cursors_;
48 48
49 // A map to hold all animated cursors. It maps the cursor ID to the pair of 49 // A map to hold all animated cursors. It maps the cursor ID to the pair of
50 // the X Cursor and the corresponding XcursorImages. We need a pointer to the 50 // the X Cursor and the corresponding XcursorImages. We need a pointer to the
51 // images so that we can free them on destruction. 51 // images so that we can free them on destruction.
52 typedef std::map<int, std::pair< ::Cursor, XcursorImages*> > 52 typedef std::map<int, std::pair< ::Cursor, XcursorImages*> >
53 AnimatedCursorMap; 53 AnimatedCursorMap;
54 AnimatedCursorMap animated_cursors_; 54 AnimatedCursorMap animated_cursors_;
55 55
56 const XScopedCursor invisible_cursor_; 56 const XScopedCursor invisible_cursor_;
57 57
58 DISALLOW_COPY_AND_ASSIGN(CursorLoaderX11); 58 DISALLOW_COPY_AND_ASSIGN(CursorLoaderX11);
59 }; 59 };
60 60
61 } // namespace ui 61 } // namespace ui
62 62
63 #endif // UI_BASE_CURSOR_CURSOR_LOADER_X11_H_ 63 #endif // UI_BASE_CURSOR_CURSOR_LOADER_X11_H_
OLDNEW
« no previous file with comments | « ui/base/cursor/cursor_loader_win.h ('k') | ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698