| 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..e25b9c201b99f7cc0fd8d4729d104efdbede494e
|
| --- /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 <vector>
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +
|
| +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();
|
| + std::vector<int> MarkedRange();
|
| + std::vector<int> SelectedRange();
|
| + std::vector<int> 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_
|
|
|