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

Side by Side Diff: ui/views/controls/textfield/native_textfield_views.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 | « ui/views/controls/single_split_view.cc ('k') | webkit/glue/webcursor.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 #include "ui/views/controls/textfield/native_textfield_views.h" 5 #include "ui/views/controls/textfield/native_textfield_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 21 matching lines...) Expand all
32 #include "ui/views/controls/textfield/textfield.h" 32 #include "ui/views/controls/textfield/textfield.h"
33 #include "ui/views/controls/textfield/textfield_controller.h" 33 #include "ui/views/controls/textfield/textfield_controller.h"
34 #include "ui/views/controls/textfield/textfield_views_model.h" 34 #include "ui/views/controls/textfield/textfield_views_model.h"
35 #include "ui/views/events/event.h" 35 #include "ui/views/events/event.h"
36 #include "ui/views/ime/input_method.h" 36 #include "ui/views/ime/input_method.h"
37 #include "ui/views/metrics.h" 37 #include "ui/views/metrics.h"
38 #include "ui/views/views_delegate.h" 38 #include "ui/views/views_delegate.h"
39 #include "ui/views/widget/widget.h" 39 #include "ui/views/widget/widget.h"
40 40
41 #if defined(USE_AURA) 41 #if defined(USE_AURA)
42 #include "ui/aura/cursor.h" 42 #include "ui/base/cursor/cursor.h"
43 #endif 43 #endif
44 44
45 namespace { 45 namespace {
46 46
47 // Text color for read only. 47 // Text color for read only.
48 const SkColor kReadonlyTextColor = SK_ColorDKGRAY; 48 const SkColor kReadonlyTextColor = SK_ColorDKGRAY;
49 49
50 // Default "system" color for text cursor. 50 // Default "system" color for text cursor.
51 const SkColor kDefaultCursorColor = SK_ColorBLACK; 51 const SkColor kDefaultCursorColor = SK_ColorBLACK;
52 52
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 OnCaretBoundsChanged(); 258 OnCaretBoundsChanged();
259 SchedulePaint(); 259 SchedulePaint();
260 OnAfterUserAction(); 260 OnAfterUserAction();
261 } 261 }
262 262
263 gfx::NativeCursor NativeTextfieldViews::GetCursor(const MouseEvent& event) { 263 gfx::NativeCursor NativeTextfieldViews::GetCursor(const MouseEvent& event) {
264 bool in_selection = GetRenderText()->IsPointInSelection(event.location()); 264 bool in_selection = GetRenderText()->IsPointInSelection(event.location());
265 bool drag_event = event.type() == ui::ET_MOUSE_DRAGGED; 265 bool drag_event = event.type() == ui::ET_MOUSE_DRAGGED;
266 bool text_cursor = !initiating_drag_ && (drag_event || !in_selection); 266 bool text_cursor = !initiating_drag_ && (drag_event || !in_selection);
267 #if defined(USE_AURA) 267 #if defined(USE_AURA)
268 return text_cursor ? aura::kCursorIBeam : aura::kCursorNull; 268 return text_cursor ? ui::kCursorIBeam : ui::kCursorNull;
269 #elif defined(OS_WIN) 269 #elif defined(OS_WIN)
270 static HCURSOR ibeam = LoadCursor(NULL, IDC_IBEAM); 270 static HCURSOR ibeam = LoadCursor(NULL, IDC_IBEAM);
271 static HCURSOR arrow = LoadCursor(NULL, IDC_ARROW); 271 static HCURSOR arrow = LoadCursor(NULL, IDC_ARROW);
272 return text_cursor ? ibeam : arrow; 272 return text_cursor ? ibeam : arrow;
273 #endif 273 #endif
274 } 274 }
275 275
276 ///////////////////////////////////////////////////////////////// 276 /////////////////////////////////////////////////////////////////
277 // NativeTextfieldViews, ContextMenuController overrides: 277 // NativeTextfieldViews, ContextMenuController overrides:
278 void NativeTextfieldViews::ShowContextMenuForView(View* source, 278 void NativeTextfieldViews::ShowContextMenuForView(View* source,
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 1115
1116 #if defined(USE_AURA) 1116 #if defined(USE_AURA)
1117 // static 1117 // static
1118 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 1118 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
1119 Textfield* field) { 1119 Textfield* field) {
1120 return new NativeTextfieldViews(field); 1120 return new NativeTextfieldViews(field);
1121 } 1121 }
1122 #endif 1122 #endif
1123 1123
1124 } // namespace views 1124 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/single_split_view.cc ('k') | webkit/glue/webcursor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698