| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 340 |
| 341 // View overrides: | 341 // View overrides: |
| 342 // Declared final since overriding by subclasses would interfere with the | 342 // Declared final since overriding by subclasses would interfere with the |
| 343 // accounting related to the scheduled text edit command. Subclasses should | 343 // accounting related to the scheduled text edit command. Subclasses should |
| 344 // use TextfieldController::HandleKeyEvent, to intercept the key event. | 344 // use TextfieldController::HandleKeyEvent, to intercept the key event. |
| 345 bool OnKeyPressed(const ui::KeyEvent& event) final; | 345 bool OnKeyPressed(const ui::KeyEvent& event) final; |
| 346 bool OnKeyReleased(const ui::KeyEvent& event) final; | 346 bool OnKeyReleased(const ui::KeyEvent& event) final; |
| 347 | 347 |
| 348 // Handles a request to change the value of this text field from software | 348 // Handles a request to change the value of this text field from software |
| 349 // using an accessibility API (typically automation software, screen readers | 349 // using an accessibility API (typically automation software, screen readers |
| 350 // don't normally use this). Sets the value and clears the selection. | 350 // don't normally use this). If |clear_first| is true, clears the existing |
| 351 void AccessibilitySetValue(const base::string16& new_value); | 351 // value first and sets it to |new_value|. If false, deletes whatever's |
| 352 // selected and replaces it with |new_value|. Then clears the text selection. |
| 353 void AccessibilitySetValue(const base::string16& new_value, bool clear_first); |
| 352 | 354 |
| 353 // Updates the painted background color. | 355 // Updates the painted background color. |
| 354 void UpdateBackgroundColor(); | 356 void UpdateBackgroundColor(); |
| 355 | 357 |
| 356 // Updates the border per the state of |invalid_|. | 358 // Updates the border per the state of |invalid_|. |
| 357 void UpdateBorder(); | 359 void UpdateBorder(); |
| 358 | 360 |
| 359 // Does necessary updates when the text and/or cursor position changes. | 361 // Does necessary updates when the text and/or cursor position changes. |
| 360 void UpdateAfterChange(bool text_changed, bool cursor_changed); | 362 void UpdateAfterChange(bool text_changed, bool cursor_changed); |
| 361 | 363 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 | 537 |
| 536 // Used to bind callback functions to this object. | 538 // Used to bind callback functions to this object. |
| 537 base::WeakPtrFactory<Textfield> weak_ptr_factory_; | 539 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
| 538 | 540 |
| 539 DISALLOW_COPY_AND_ASSIGN(Textfield); | 541 DISALLOW_COPY_AND_ASSIGN(Textfield); |
| 540 }; | 542 }; |
| 541 | 543 |
| 542 } // namespace views | 544 } // namespace views |
| 543 | 545 |
| 544 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 546 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| OLD | NEW |