| OLD | NEW |
| 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 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 | 366 |
| 367 // Updates the border per the state of |invalid_|. | 367 // Updates the border per the state of |invalid_|. |
| 368 void UpdateBorder(); | 368 void UpdateBorder(); |
| 369 | 369 |
| 370 // Does necessary updates when the text and/or cursor position changes. | 370 // Does necessary updates when the text and/or cursor position changes. |
| 371 void UpdateAfterChange(bool text_changed, bool cursor_changed); | 371 void UpdateAfterChange(bool text_changed, bool cursor_changed); |
| 372 | 372 |
| 373 // A callback function to periodically update the cursor node_data. | 373 // A callback function to periodically update the cursor node_data. |
| 374 void UpdateCursor(); | 374 void UpdateCursor(); |
| 375 | 375 |
| 376 // Repaint the cursor. | 376 // Update the cursor position in the text field. |
| 377 void RepaintCursor(); | 377 void UpdateCursorView(); |
| 378 | 378 |
| 379 void PaintTextAndCursor(gfx::Canvas* canvas); | 379 void PaintTextAndCursor(gfx::Canvas* canvas); |
| 380 | 380 |
| 381 // Helper function to call MoveCursorTo on the TextfieldModel. | 381 // Helper function to call MoveCursorTo on the TextfieldModel. |
| 382 void MoveCursorTo(const gfx::Point& point, bool select); | 382 void MoveCursorTo(const gfx::Point& point, bool select); |
| 383 | 383 |
| 384 // Convenience method to notify the InputMethod and TouchSelectionController. | 384 // Convenience method to notify the InputMethod and TouchSelectionController. |
| 385 void OnCaretBoundsChanged(); | 385 void OnCaretBoundsChanged(); |
| 386 | 386 |
| 387 // Convenience method to call TextfieldController::OnBeforeUserAction(); | 387 // Convenience method to call TextfieldController::OnBeforeUserAction(); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 // scrolling. If |true|, handles are shown after scrolling ends. | 517 // scrolling. If |true|, handles are shown after scrolling ends. |
| 518 bool touch_handles_hidden_due_to_scroll_; | 518 bool touch_handles_hidden_due_to_scroll_; |
| 519 | 519 |
| 520 // True if this textfield should use a focus ring to indicate focus. | 520 // True if this textfield should use a focus ring to indicate focus. |
| 521 bool use_focus_ring_; | 521 bool use_focus_ring_; |
| 522 | 522 |
| 523 // Context menu related members. | 523 // Context menu related members. |
| 524 std::unique_ptr<ui::SimpleMenuModel> context_menu_contents_; | 524 std::unique_ptr<ui::SimpleMenuModel> context_menu_contents_; |
| 525 std::unique_ptr<views::MenuRunner> context_menu_runner_; | 525 std::unique_ptr<views::MenuRunner> context_menu_runner_; |
| 526 | 526 |
| 527 // View containing the text cursor. |
| 528 View cursor_view_; |
| 529 |
| 527 // Used to bind callback functions to this object. | 530 // Used to bind callback functions to this object. |
| 528 base::WeakPtrFactory<Textfield> weak_ptr_factory_; | 531 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
| 529 | 532 |
| 530 DISALLOW_COPY_AND_ASSIGN(Textfield); | 533 DISALLOW_COPY_AND_ASSIGN(Textfield); |
| 531 }; | 534 }; |
| 532 | 535 |
| 533 } // namespace views | 536 } // namespace views |
| 534 | 537 |
| 535 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 538 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| OLD | NEW |