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

Unified Diff: ui/views/controls/textfield/textfield.h

Issue 2029733003: Views: Replace resource ids with ui::TextEditCommand enum for text editing commands in Textfield. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: === Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/prefix_selector.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.h
diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h
index 938d03de3cd055fd1a11782c3637b85ddd877140..56fdd9ccf4c535bc21c278842f2a794d0f30b279 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -200,9 +200,6 @@ class VIEWS_EXPORT Textfield : public View,
// Set the accessible name of the text field.
void SetAccessibleName(const base::string16& name);
- // Performs the action associated with the specified command id.
- void ExecuteCommand(int command_id);
-
// Returns whether there is a drag operation originating from the textfield.
bool HasTextBeingDragged();
@@ -304,8 +301,8 @@ class VIEWS_EXPORT Textfield : public View,
base::i18n::TextDirection direction) override;
void ExtendSelectionAndDelete(size_t before, size_t after) override;
void EnsureCaretInRect(const gfx::Rect& rect) override;
- bool IsEditCommandEnabled(int command_id) const override;
- void SetEditCommandForNextKeyEvent(int command_id) override;
+ bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override;
+ void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override;
protected:
// Inserts or appends a character in response to an IME operation.
@@ -319,6 +316,9 @@ class VIEWS_EXPORT Textfield : public View,
// Get the text from the selection clipboard.
virtual base::string16 GetSelectionClipboardText() const;
+ // Executes the given |command|.
+ virtual void ExecuteTextEditCommand(ui::TextEditCommand command);
+
private:
friend class TextfieldTestApi;
@@ -393,11 +393,12 @@ class VIEWS_EXPORT Textfield : public View,
// This is the current listener for events from this Textfield.
TextfieldController* controller_;
- // If non-zero, an edit command to execute on the next key event. When set,
- // the key event is still passed to |controller_|, but otherwise ignored in
- // favor of the edit command. Set via SetEditCommandForNextKeyEvent() during
- // dispatch of that key event (see comment in TextInputClient).
- int scheduled_edit_command_;
+ // An edit command to execute on the next key event. When set to a valid
+ // value, the key event is still passed to |controller_|, but otherwise
+ // ignored in favor of the edit command. Set via
+ // SetTextEditCommandForNextKeyEvent() during dispatch of that key event (see
+ // comment in TextInputClient).
+ ui::TextEditCommand scheduled_text_edit_command_;
// True if this Textfield cannot accept input and is read-only.
bool read_only_;
« no previous file with comments | « ui/views/controls/prefix_selector.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698