| 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 // Declared final since overriding by subclasses would interfere with the | 324 // Declared final since overriding by subclasses would interfere with the |
| 325 // accounting related to the scheduled text edit command. Subclasses should | 325 // accounting related to the scheduled text edit command. Subclasses should |
| 326 // use TextfieldController::HandleKeyEvent, to intercept the key event. | 326 // use TextfieldController::HandleKeyEvent, to intercept the key event. |
| 327 bool OnKeyPressed(const ui::KeyEvent& event) final; | 327 bool OnKeyPressed(const ui::KeyEvent& event) final; |
| 328 bool OnKeyReleased(const ui::KeyEvent& event) final; | 328 bool OnKeyReleased(const ui::KeyEvent& event) final; |
| 329 | 329 |
| 330 // Handles a request to change the value of this text field from software | 330 // Handles a request to change the value of this text field from software |
| 331 // using an accessibility API (typically automation software, screen readers | 331 // using an accessibility API (typically automation software, screen readers |
| 332 // don't normally use this). Sets the value and clears the selection. | 332 // don't normally use this). Sets the value and clears the selection. |
| 333 void AccessibilitySetValue(const base::string16& new_value); | 333 void AccessibilitySetValue(const base::string16& new_value); |
| 334 // Same as above, but replaces selected text/inserts new text at the cursor. |
| 335 void AccessibilityReplaceSelection(const base::string16& new_value); |
| 334 | 336 |
| 335 // Updates the painted background color. | 337 // Updates the painted background color. |
| 336 void UpdateBackgroundColor(); | 338 void UpdateBackgroundColor(); |
| 337 | 339 |
| 338 // Does necessary updates when the text and/or cursor position changes. | 340 // Does necessary updates when the text and/or cursor position changes. |
| 339 void UpdateAfterChange(bool text_changed, bool cursor_changed); | 341 void UpdateAfterChange(bool text_changed, bool cursor_changed); |
| 340 | 342 |
| 341 // A callback function to periodically update the cursor state. | 343 // A callback function to periodically update the cursor state. |
| 342 void UpdateCursor(); | 344 void UpdateCursor(); |
| 343 | 345 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 | 494 |
| 493 // Used to bind callback functions to this object. | 495 // Used to bind callback functions to this object. |
| 494 base::WeakPtrFactory<Textfield> weak_ptr_factory_; | 496 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
| 495 | 497 |
| 496 DISALLOW_COPY_AND_ASSIGN(Textfield); | 498 DISALLOW_COPY_AND_ASSIGN(Textfield); |
| 497 }; | 499 }; |
| 498 | 500 |
| 499 } // namespace views | 501 } // namespace views |
| 500 | 502 |
| 501 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 503 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| OLD | NEW |