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

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

Issue 2558623003: Linux aura: use all-scroll cursor in place of move (Closed)
Patch Set: Fix comment' Created 4 years 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 | no next file » | 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 "ui/base/cursor/cursor_loader_x11.h" 5 #include "ui/base/cursor/cursor_loader_x11.h"
6 6
7 #include <float.h> 7 #include <float.h>
8 #include <X11/cursorfont.h> 8 #include <X11/cursorfont.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 case ui::kCursorHand: 80 case ui::kCursorHand:
81 // In some environments, the image assets are not set (e.g. in 81 // In some environments, the image assets are not set (e.g. in
82 // content-browsertests, content-shell etc.). 82 // content-browsertests, content-shell etc.).
83 return "left_ptr"; 83 return "left_ptr";
84 #else // defined(OS_CHROMEOS) 84 #else // defined(OS_CHROMEOS)
85 case ui::kCursorNull: 85 case ui::kCursorNull:
86 return "left_ptr"; 86 return "left_ptr";
87 case ui::kCursorPointer: 87 case ui::kCursorPointer:
88 return "left_ptr"; 88 return "left_ptr";
89 case ui::kCursorMove: 89 case ui::kCursorMove:
90 return "move"; 90 // Returning "move" is the correct thing here, but Blink doesn't
91 // make a distinction between move and all-scroll. Other
92 // platforms use a cursor more consistent with all-scroll, so
93 // use that.
94 return "all-scroll";
91 case ui::kCursorCross: 95 case ui::kCursorCross:
92 return "crosshair"; 96 return "crosshair";
93 case ui::kCursorHand: 97 case ui::kCursorHand:
94 return "pointer"; 98 return "pointer";
95 case ui::kCursorIBeam: 99 case ui::kCursorIBeam:
96 return "text"; 100 return "text";
97 case ui::kCursorProgress: 101 case ui::kCursorProgress:
98 return "progress"; 102 return "progress";
99 case ui::kCursorWait: 103 case ui::kCursorWait:
100 return "wait"; 104 return "wait";
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 169
166 static const struct { 170 static const struct {
167 const char* css_name; 171 const char* css_name;
168 const char* fallback_name; 172 const char* fallback_name;
169 int fallback_shape; 173 int fallback_shape;
170 } kCursorFallbacks[] = { 174 } kCursorFallbacks[] = {
171 { "pointer", "hand", XC_hand1 }, 175 { "pointer", "hand", XC_hand1 },
172 { "progress", "left_ptr_watch", XC_watch }, 176 { "progress", "left_ptr_watch", XC_watch },
173 { "wait", nullptr, XC_watch }, 177 { "wait", nullptr, XC_watch },
174 { "cell", nullptr, XC_plus }, 178 { "cell", nullptr, XC_plus },
179 { "all-scroll", nullptr, XC_fleur},
175 { "crosshair", nullptr, XC_cross }, 180 { "crosshair", nullptr, XC_cross },
176 { "text", nullptr, XC_xterm }, 181 { "text", nullptr, XC_xterm },
177 { "not-allowed", "crossed_circle", None }, 182 { "not-allowed", "crossed_circle", None },
178 { "grabbing", nullptr, XC_hand2 }, 183 { "grabbing", nullptr, XC_hand2 },
179 { "col-resize", nullptr, XC_sb_h_double_arrow }, 184 { "col-resize", nullptr, XC_sb_h_double_arrow },
180 { "row-resize", nullptr, XC_sb_v_double_arrow}, 185 { "row-resize", nullptr, XC_sb_v_double_arrow},
181 { "n-resize", nullptr, XC_top_side}, 186 { "n-resize", nullptr, XC_top_side},
182 { "e-resize", nullptr, XC_right_side}, 187 { "e-resize", nullptr, XC_right_side},
183 { "s-resize", nullptr, XC_bottom_side}, 188 { "s-resize", nullptr, XC_bottom_side},
184 { "w-resize", nullptr, XC_left_side}, 189 { "w-resize", nullptr, XC_left_side},
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 341 }
337 342
338 // As a last resort, return a left pointer. 343 // As a last resort, return a left pointer.
339 cursor = XCreateFontCursor(display_, XC_left_ptr); 344 cursor = XCreateFontCursor(display_, XC_left_ptr);
340 DCHECK(cursor); 345 DCHECK(cursor);
341 font_cursors_[id] = cursor; 346 font_cursors_[id] = cursor;
342 return cursor; 347 return cursor;
343 } 348 }
344 349
345 } // namespace ui 350 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698