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

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

Issue 6628037: views: Moves TextfieldController/TextRange into their own headers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 9 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 | « views/controls/textfield/textfield.cc ('k') | views/controls/textfield/textfield_views_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/textfield_controller.h
diff --git a/views/controls/textfield/textfield_controller.h b/views/controls/textfield/textfield_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..53fe97cdd4ec37ce78f3d7d059aca7283baeabb2
--- /dev/null
+++ b/views/controls/textfield/textfield_controller.h
@@ -0,0 +1,33 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_
+#define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_
+#pragma once
+
+#include "base/string16.h"
+
+namespace views {
+
+class KeyEvent;
+class Textfield;
+
+// This defines the callback interface for other code to be notified of changes
+// in the state of a text field.
+class TextfieldController {
+ public:
+ // This method is called whenever the text in the field changes.
+ virtual void ContentsChanged(Textfield* sender,
+ const string16& new_contents) = 0;
+
+ // This method is called to get notified about keystrokes in the edit.
+ // Returns true if the message was handled and should not be processed
+ // further. If it returns false the processing continues.
+ virtual bool HandleKeyEvent(Textfield* sender,
+ const KeyEvent& key_event) = 0;
+};
+
+} // namespace views
+
+#endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_
« no previous file with comments | « views/controls/textfield/textfield.cc ('k') | views/controls/textfield/textfield_views_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698