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

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

Issue 2273263002: MacViewsBrowser: Fix omnibox crash due to failed DCHECK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile. Created 4 years, 4 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
Index: ui/views/controls/textfield/textfield.h
diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h
index 54391a380cb8ac1b51e0dd753f01014f045b569b..35938b320c58c754003b0b20d93cae7e45301e9c 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -212,8 +212,6 @@ class VIEWS_EXPORT Textfield : public View,
bool OnMousePressed(const ui::MouseEvent& event) override;
bool OnMouseDragged(const ui::MouseEvent& event) override;
void OnMouseReleased(const ui::MouseEvent& event) override;
- bool OnKeyPressed(const ui::KeyEvent& event) override;
- bool OnKeyReleased(const ui::KeyEvent& event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
bool CanHandleAccelerators() const override;
@@ -321,8 +319,18 @@ class VIEWS_EXPORT Textfield : public View,
virtual void ExecuteTextEditCommand(ui::TextEditCommand command);
private:
+ friend class TestTextfield;
friend class TextfieldTestApi;
+ // View overrides:
+ // OnKey[Pressed/Released] are virtual only so that they can be overridden in
+ // tests. Subclasses should not override these, since it would interfere with
+ // the accounting related to the scheduled text edit command. Instead
+ // subclasses should use TextfieldController::HandleKeyEvent, to intercept the
+ // key event.
+ bool OnKeyPressed(const ui::KeyEvent& event) override;
+ bool OnKeyReleased(const ui::KeyEvent& event) override;
+
// Handles a request to change the value of this text field from software
// using an accessibility API (typically automation software, screen readers
// don't normally use this). Sets the value and clears the selection.

Powered by Google App Engine
This is Rietveld 408576698