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

Side by Side Diff: webkit/glue/webcursor_aura.cc

Issue 9463003: aura-x11: Add custom web cursor support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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
« no previous file with comments | « webkit/glue/webcursor.h ('k') | webkit/glue/webcursor_aurawin.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 (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 #include "webkit/glue/webcursor.h" 5 #include "webkit/glue/webcursor.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
9 #include "ui/aura/cursor.h" 9 #include "ui/base/cursor/cursor.h"
10 10
11 using WebKit::WebCursorInfo; 11 using WebKit::WebCursorInfo;
12 12
13 gfx::NativeCursor WebCursor::GetNativeCursor() { 13 gfx::NativeCursor WebCursor::GetNativeCursor() {
14 switch (type_) { 14 switch (type_) {
15 case WebCursorInfo::TypePointer: 15 case WebCursorInfo::TypePointer:
16 return aura::kCursorPointer; 16 return ui::kCursorPointer;
17 case WebCursorInfo::TypeCross: 17 case WebCursorInfo::TypeCross:
18 return aura::kCursorCross; 18 return ui::kCursorCross;
19 case WebCursorInfo::TypeHand: 19 case WebCursorInfo::TypeHand:
20 return aura::kCursorHand; 20 return ui::kCursorHand;
21 case WebCursorInfo::TypeIBeam: 21 case WebCursorInfo::TypeIBeam:
22 return aura::kCursorIBeam; 22 return ui::kCursorIBeam;
23 case WebCursorInfo::TypeWait: 23 case WebCursorInfo::TypeWait:
24 return aura::kCursorWait; 24 return ui::kCursorWait;
25 case WebCursorInfo::TypeHelp: 25 case WebCursorInfo::TypeHelp:
26 return aura::kCursorHelp; 26 return ui::kCursorHelp;
27 case WebCursorInfo::TypeEastResize: 27 case WebCursorInfo::TypeEastResize:
28 return aura::kCursorEastResize; 28 return ui::kCursorEastResize;
29 case WebCursorInfo::TypeNorthResize: 29 case WebCursorInfo::TypeNorthResize:
30 return aura::kCursorNorthResize; 30 return ui::kCursorNorthResize;
31 case WebCursorInfo::TypeNorthEastResize: 31 case WebCursorInfo::TypeNorthEastResize:
32 return aura::kCursorNorthEastResize; 32 return ui::kCursorNorthEastResize;
33 case WebCursorInfo::TypeNorthWestResize: 33 case WebCursorInfo::TypeNorthWestResize:
34 return aura::kCursorNorthWestResize; 34 return ui::kCursorNorthWestResize;
35 case WebCursorInfo::TypeSouthResize: 35 case WebCursorInfo::TypeSouthResize:
36 return aura::kCursorSouthResize; 36 return ui::kCursorSouthResize;
37 case WebCursorInfo::TypeSouthEastResize: 37 case WebCursorInfo::TypeSouthEastResize:
38 return aura::kCursorSouthEastResize; 38 return ui::kCursorSouthEastResize;
39 case WebCursorInfo::TypeSouthWestResize: 39 case WebCursorInfo::TypeSouthWestResize:
40 return aura::kCursorSouthWestResize; 40 return ui::kCursorSouthWestResize;
41 case WebCursorInfo::TypeWestResize: 41 case WebCursorInfo::TypeWestResize:
42 return aura::kCursorWestResize; 42 return ui::kCursorWestResize;
43 case WebCursorInfo::TypeNorthSouthResize: 43 case WebCursorInfo::TypeNorthSouthResize:
44 return aura::kCursorNorthSouthResize; 44 return ui::kCursorNorthSouthResize;
45 case WebCursorInfo::TypeEastWestResize: 45 case WebCursorInfo::TypeEastWestResize:
46 return aura::kCursorEastWestResize; 46 return ui::kCursorEastWestResize;
47 case WebCursorInfo::TypeNorthEastSouthWestResize: 47 case WebCursorInfo::TypeNorthEastSouthWestResize:
48 return aura::kCursorNorthEastSouthWestResize; 48 return ui::kCursorNorthEastSouthWestResize;
49 case WebCursorInfo::TypeNorthWestSouthEastResize: 49 case WebCursorInfo::TypeNorthWestSouthEastResize:
50 return aura::kCursorNorthWestSouthEastResize; 50 return ui::kCursorNorthWestSouthEastResize;
51 case WebCursorInfo::TypeColumnResize: 51 case WebCursorInfo::TypeColumnResize:
52 return aura::kCursorColumnResize; 52 return ui::kCursorColumnResize;
53 case WebCursorInfo::TypeRowResize: 53 case WebCursorInfo::TypeRowResize:
54 return aura::kCursorRowResize; 54 return ui::kCursorRowResize;
55 case WebCursorInfo::TypeMiddlePanning: 55 case WebCursorInfo::TypeMiddlePanning:
56 return aura::kCursorMiddlePanning; 56 return ui::kCursorMiddlePanning;
57 case WebCursorInfo::TypeEastPanning: 57 case WebCursorInfo::TypeEastPanning:
58 return aura::kCursorEastPanning; 58 return ui::kCursorEastPanning;
59 case WebCursorInfo::TypeNorthPanning: 59 case WebCursorInfo::TypeNorthPanning:
60 return aura::kCursorNorthPanning; 60 return ui::kCursorNorthPanning;
61 case WebCursorInfo::TypeNorthEastPanning: 61 case WebCursorInfo::TypeNorthEastPanning:
62 return aura::kCursorNorthEastPanning; 62 return ui::kCursorNorthEastPanning;
63 case WebCursorInfo::TypeNorthWestPanning: 63 case WebCursorInfo::TypeNorthWestPanning:
64 return aura::kCursorNorthWestPanning; 64 return ui::kCursorNorthWestPanning;
65 case WebCursorInfo::TypeSouthPanning: 65 case WebCursorInfo::TypeSouthPanning:
66 return aura::kCursorSouthPanning; 66 return ui::kCursorSouthPanning;
67 case WebCursorInfo::TypeSouthEastPanning: 67 case WebCursorInfo::TypeSouthEastPanning:
68 return aura::kCursorSouthEastPanning; 68 return ui::kCursorSouthEastPanning;
69 case WebCursorInfo::TypeSouthWestPanning: 69 case WebCursorInfo::TypeSouthWestPanning:
70 return aura::kCursorSouthWestPanning; 70 return ui::kCursorSouthWestPanning;
71 case WebCursorInfo::TypeWestPanning: 71 case WebCursorInfo::TypeWestPanning:
72 return aura::kCursorWestPanning; 72 return ui::kCursorWestPanning;
73 case WebCursorInfo::TypeMove: 73 case WebCursorInfo::TypeMove:
74 return aura::kCursorMove; 74 return ui::kCursorMove;
75 case WebCursorInfo::TypeVerticalText: 75 case WebCursorInfo::TypeVerticalText:
76 return aura::kCursorVerticalText; 76 return ui::kCursorVerticalText;
77 case WebCursorInfo::TypeCell: 77 case WebCursorInfo::TypeCell:
78 return aura::kCursorCell; 78 return ui::kCursorCell;
79 case WebCursorInfo::TypeContextMenu: 79 case WebCursorInfo::TypeContextMenu:
80 return aura::kCursorContextMenu; 80 return ui::kCursorContextMenu;
81 case WebCursorInfo::TypeAlias: 81 case WebCursorInfo::TypeAlias:
82 return aura::kCursorAlias; 82 return ui::kCursorAlias;
83 case WebCursorInfo::TypeProgress: 83 case WebCursorInfo::TypeProgress:
84 return aura::kCursorProgress; 84 return ui::kCursorProgress;
85 case WebCursorInfo::TypeNoDrop: 85 case WebCursorInfo::TypeNoDrop:
86 return aura::kCursorNoDrop; 86 return ui::kCursorNoDrop;
87 case WebCursorInfo::TypeCopy: 87 case WebCursorInfo::TypeCopy:
88 return aura::kCursorCopy; 88 return ui::kCursorCopy;
89 case WebCursorInfo::TypeNone: 89 case WebCursorInfo::TypeNone:
90 return aura::kCursorNone; 90 return ui::kCursorNone;
91 case WebCursorInfo::TypeNotAllowed: 91 case WebCursorInfo::TypeNotAllowed:
92 return aura::kCursorNotAllowed; 92 return ui::kCursorNotAllowed;
93 case WebCursorInfo::TypeZoomIn: 93 case WebCursorInfo::TypeZoomIn:
94 return aura::kCursorZoomIn; 94 return ui::kCursorZoomIn;
95 case WebCursorInfo::TypeZoomOut: 95 case WebCursorInfo::TypeZoomOut:
96 return aura::kCursorZoomOut; 96 return ui::kCursorZoomOut;
97 case WebCursorInfo::TypeGrab: 97 case WebCursorInfo::TypeGrab:
98 return aura::kCursorGrab; 98 return ui::kCursorGrab;
99 case WebCursorInfo::TypeGrabbing: 99 case WebCursorInfo::TypeGrabbing:
100 return aura::kCursorGrabbing; 100 return ui::kCursorGrabbing;
101 case WebCursorInfo::TypeCustom: 101 case WebCursorInfo::TypeCustom: {
102 return aura::kCursorCustom; 102 ui::Cursor cursor;
103 cursor.SetPlatformCursor(GetPlatformCursor());
104 return cursor;
105 }
103 default: 106 default:
104 NOTREACHED(); 107 NOTREACHED();
105 return gfx::kNullCursor; 108 return gfx::kNullCursor;
106 } 109 }
107 } 110 }
108
109 void WebCursor::InitPlatformData() {
110 }
111
112 bool WebCursor::SerializePlatformData(Pickle* pickle) const {
113 return true;
114 }
115
116 bool WebCursor::DeserializePlatformData(PickleIterator* iter) {
117 return true;
118 }
119
120 bool WebCursor::IsPlatformDataEqual(const WebCursor& other) const {
121 return true;
122 }
123
124 void WebCursor::CleanupPlatformData() {
125 }
126
127 void WebCursor::CopyPlatformData(const WebCursor& other) {
128 }
OLDNEW
« no previous file with comments | « webkit/glue/webcursor.h ('k') | webkit/glue/webcursor_aurawin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698