OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |