Index: content/shell/renderer/test_runner/text_input_controller.h |
diff --git a/content/shell/renderer/test_runner/text_input_controller.h b/content/shell/renderer/test_runner/text_input_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8a358a92a91dc87cb00babd62042723a41c4ba87 |
--- /dev/null |
+++ b/content/shell/renderer/test_runner/text_input_controller.h |
@@ -0,0 +1,52 @@ |
+// Copyright 2014 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 CONTENT_SHELL_RENDERER_TEST_RUNNER_TEXTINPUTCONTROLLER_H_ |
+#define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEXTINPUTCONTROLLER_H_ |
+ |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "base/memory/weak_ptr.h" |
+#include "third_party/WebKit/public/web/WebBindings.h" |
jochen (gone - plz use gerrit)
2014/02/13 13:08:24
don't include this
tfarina
2014/02/13 13:14:06
Done.
|
+ |
+namespace blink { |
+class WebFrame; |
+} |
+ |
+namespace content { |
+ |
+// TextInputController is bound to window.textInputController in Javascript |
+// when content_shell is running. Layout tests use it to exercise various |
+// corners of text input. |
+class TextInputController : public base::SupportsWeakPtr<TextInputController> { |
+ public: |
+ TextInputController(); |
+ ~TextInputController(); |
+ |
+ void Install(blink::WebFrame* frame); |
+ |
+ private: |
+ friend class TextInputControllerBindings; |
+ |
+ void InsertText(const std::string& text); |
+ void UnmarkText(); |
+ void DoCommand(const std::string& text); |
+ void SetMarkedText(const std::string& text); |
+ bool HasMarkedText(); |
+ NPObject* MarkedRange(); |
+ NPObject* SelectedRange(); |
jochen (gone - plz use gerrit)
2014/02/13 13:08:24
don't return an NPObject here. Return std::vector<
tfarina
2014/02/13 13:14:06
Done.
|
+ NPObject* FirstRectForCharacterRange(const std::string& text); |
+ void SetComposition(const std::string& text); |
+ |
+ blink::WebFrame* frame_; |
+ |
+ base::WeakPtrFactory<TextInputController> weak_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TextInputController); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEXTINPUTCONTROLLER_H_ |