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

Side by Side Diff: ui/views/controls/textfield/native_textfield_views.h

Issue 61923005: Make NativeTextfieldViews update the win system caret. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix leak, update every time caret is painted Created 7 years, 1 month 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 281
282 void CreateTouchSelectionControllerAndNotifyIt(); 282 void CreateTouchSelectionControllerAndNotifyIt();
283 283
284 // Platform specific gesture event handling. 284 // Platform specific gesture event handling.
285 void PlatformGestureEventHandling(const ui::GestureEvent* event); 285 void PlatformGestureEventHandling(const ui::GestureEvent* event);
286 286
287 // Reveals the obscured char at |index| for the given |duration|. If |index| 287 // Reveals the obscured char at |index| for the given |duration|. If |index|
288 // is -1, existing revealed index will be cleared. 288 // is -1, existing revealed index will be cleared.
289 void RevealObscuredChar(int index, const base::TimeDelta& duration); 289 void RevealObscuredChar(int index, const base::TimeDelta& duration);
290 290
291 // Platform-specific updating of the system caret location to match ours.
292 void PlatformUpdateSystemCaret();
293
294 // Platform-specific hiding of the system caret whe we lose focus.
295 void PlatformHideSystemCaret();
296
291 // The parent textfield, the owner of this object. 297 // The parent textfield, the owner of this object.
292 Textfield* textfield_; 298 Textfield* textfield_;
293 299
294 // The text model. 300 // The text model.
295 scoped_ptr<TextfieldViewsModel> model_; 301 scoped_ptr<TextfieldViewsModel> model_;
296 302
297 // The focusable border. This is always non-NULL, but may not actually be 303 // The focusable border. This is always non-NULL, but may not actually be
298 // drawn. If it is not drawn, then by default it's also zero-sized unless the 304 // drawn. If it is not drawn, then by default it's also zero-sized unless the
299 // Textfield has explicitly-set margins. 305 // Textfield has explicitly-set margins.
300 FocusableBorder* text_border_; 306 FocusableBorder* text_border_;
(...skipping 26 matching lines...) Expand all
327 scoped_ptr<views::MenuModelAdapter> context_menu_delegate_; 333 scoped_ptr<views::MenuModelAdapter> context_menu_delegate_;
328 scoped_ptr<views::MenuRunner> context_menu_runner_; 334 scoped_ptr<views::MenuRunner> context_menu_runner_;
329 335
330 scoped_ptr<ui::TouchSelectionController> touch_selection_controller_; 336 scoped_ptr<ui::TouchSelectionController> touch_selection_controller_;
331 337
332 // A timer to control the duration of showing the last typed char in 338 // A timer to control the duration of showing the last typed char in
333 // obscured text. When the timer is running, the last typed char is shown 339 // obscured text. When the timer is running, the last typed char is shown
334 // and when the time expires, the last typed char is obscured. 340 // and when the time expires, the last typed char is obscured.
335 base::OneShotTimer<NativeTextfieldViews> obscured_reveal_timer_; 341 base::OneShotTimer<NativeTextfieldViews> obscured_reveal_timer_;
336 342
343 // The last caret rect, in screen coordinates.
344 gfx::Rect last_caret_rect_;
345
337 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldViews); 346 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldViews);
338 }; 347 };
339 348
340 } // namespace views 349 } // namespace views
341 350
342 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ 351 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698