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

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

Issue 2341633006: MacViews/a11y: Allow accessibility clients to update the selected text. (Closed)
Patch Set: Make set value callbacks not have a const bool |replace| arg. Created 4 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) 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
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). Sets the value and clears the selection. If
351 void AccessibilitySetValue(const base::string16& new_value); 351 // |replace| is set, insert at the cursor or replace selected text.
352 void AccessibilitySetValue(const base::string16& new_value, bool replace);
352 353
353 // Updates the painted background color. 354 // Updates the painted background color.
354 void UpdateBackgroundColor(); 355 void UpdateBackgroundColor();
355 356
356 // Updates the border per the state of |invalid_|. 357 // Updates the border per the state of |invalid_|.
357 void UpdateBorder(); 358 void UpdateBorder();
358 359
359 // Does necessary updates when the text and/or cursor position changes. 360 // Does necessary updates when the text and/or cursor position changes.
360 void UpdateAfterChange(bool text_changed, bool cursor_changed); 361 void UpdateAfterChange(bool text_changed, bool cursor_changed);
361 362
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 536
536 // Used to bind callback functions to this object. 537 // Used to bind callback functions to this object.
537 base::WeakPtrFactory<Textfield> weak_ptr_factory_; 538 base::WeakPtrFactory<Textfield> weak_ptr_factory_;
538 539
539 DISALLOW_COPY_AND_ASSIGN(Textfield); 540 DISALLOW_COPY_AND_ASSIGN(Textfield);
540 }; 541 };
541 542
542 } // namespace views 543 } // namespace views
543 544
544 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 545 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698