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

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

Issue 2829823002: [Textfield] Consider select all status for select all context menu (Closed)
Patch Set: Add test for empty text Created 3 years, 8 months 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 // Returns the text that is currently selected. Call sites should take care to 99 // Returns the text that is currently selected. Call sites should take care to
100 // not reveal the text for a password textfield. 100 // not reveal the text for a password textfield.
101 base::string16 GetSelectedText() const; 101 base::string16 GetSelectedText() const;
102 102
103 // Select the entire text range. If |reversed| is true, the range will end at 103 // Select the entire text range. If |reversed| is true, the range will end at
104 // the logical beginning of the text; this generally shows the leading portion 104 // the logical beginning of the text; this generally shows the leading portion
105 // of text that overflows its display area. 105 // of text that overflows its display area.
106 void SelectAll(bool reversed); 106 void SelectAll(bool reversed);
107 107
108 // Return false when text is empty.
Peter Kasting 2017/04/20 00:08:30 Nit: "Returns whether all the text is currently se
simonhong 2017/04/20 13:11:51 Removed.
109 bool IsAllSelected() const;
Peter Kasting 2017/04/20 00:08:30 Nit: Does this need to be public? If we're only u
simonhong 2017/04/20 13:11:51 Making it public is mistake. At first, I added as
110
108 // A convenience method to select the word closest to |point|. 111 // A convenience method to select the word closest to |point|.
109 void SelectWordAt(const gfx::Point& point); 112 void SelectWordAt(const gfx::Point& point);
110 113
111 // Clears the selection within the edit field and sets the caret to the end. 114 // Clears the selection within the edit field and sets the caret to the end.
112 void ClearSelection(); 115 void ClearSelection();
113 116
114 // Checks if there is any selected text. 117 // Checks if there is any selected text.
115 bool HasSelection() const; 118 bool HasSelection() const;
116 119
117 // Gets/sets the text color to be used when painting the Textfield. 120 // Gets/sets the text color to be used when painting the Textfield.
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 535
533 // Used to bind callback functions to this object. 536 // Used to bind callback functions to this object.
534 base::WeakPtrFactory<Textfield> weak_ptr_factory_; 537 base::WeakPtrFactory<Textfield> weak_ptr_factory_;
535 538
536 DISALLOW_COPY_AND_ASSIGN(Textfield); 539 DISALLOW_COPY_AND_ASSIGN(Textfield);
537 }; 540 };
538 541
539 } // namespace views 542 } // namespace views
540 543
541 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 544 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield.cc » ('j') | ui/views/controls/textfield/textfield.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698