| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // TextInputController is bound to window.textInputController in Javascript | 5 // TextInputController is bound to window.textInputController in Javascript |
| 6 // when test_shell is running in layout test mode. Layout tests use it to | 6 // when test_shell is running in layout test mode. Layout tests use it to |
| 7 // exercise various corners of text input. | 7 // exercise various corners of text input. |
| 8 // | 8 // |
| 9 // Mac equivalent: WebKit/WebKitTools/DumpRenderTree/TextInputController.{h,m} | 9 // Mac equivalent: WebKit/WebKitTools/DumpRenderTree/TextInputController.{h,m} |
| 10 | 10 |
| 11 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEXT_INPUT_CONTROLLER_H__ | 11 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEXT_INPUT_CONTROLLER_H__ |
| 12 #define WEBKIT_TOOLS_TEST_SHELL_TEXT_INPUT_CONTROLLER_H__ | 12 #define WEBKIT_TOOLS_TEST_SHELL_TEXT_INPUT_CONTROLLER_H__ |
| 13 | 13 |
| 14 #include "webkit/glue/cpp_bound_class.h" | 14 #include "webkit/glue/cpp_bound_class.h" |
| 15 | 15 |
| 16 class TestShell; | 16 class TestShell; |
| 17 class WebView; | 17 |
| 18 class WebTextInput; | 18 namespace WebKit { |
| 19 class WebFrame; |
| 20 } |
| 19 | 21 |
| 20 class TextInputController : public CppBoundClass { | 22 class TextInputController : public CppBoundClass { |
| 21 public: | 23 public: |
| 22 TextInputController(TestShell* shell); | 24 TextInputController(TestShell* shell); |
| 23 | 25 |
| 24 void insertText(const CppArgumentList& args, CppVariant* result); | 26 void insertText(const CppArgumentList& args, CppVariant* result); |
| 25 void doCommand(const CppArgumentList& args, CppVariant* result); | 27 void doCommand(const CppArgumentList& args, CppVariant* result); |
| 26 void setMarkedText(const CppArgumentList& args, CppVariant* result); | 28 void setMarkedText(const CppArgumentList& args, CppVariant* result); |
| 27 void unmarkText(const CppArgumentList& args, CppVariant* result); | 29 void unmarkText(const CppArgumentList& args, CppVariant* result); |
| 28 void hasMarkedText(const CppArgumentList& args, CppVariant* result); | 30 void hasMarkedText(const CppArgumentList& args, CppVariant* result); |
| 29 void conversationIdentifier(const CppArgumentList& args, CppVariant* result); | 31 void conversationIdentifier(const CppArgumentList& args, CppVariant* result); |
| 30 void substringFromRange(const CppArgumentList& args, CppVariant* result); | 32 void substringFromRange(const CppArgumentList& args, CppVariant* result); |
| 31 void attributedSubstringFromRange(const CppArgumentList& args, CppVariant* res
ult); | 33 void attributedSubstringFromRange(const CppArgumentList& args, CppVariant* res
ult); |
| 32 void markedRange(const CppArgumentList& args, CppVariant* result); | 34 void markedRange(const CppArgumentList& args, CppVariant* result); |
| 33 void selectedRange(const CppArgumentList& args, CppVariant* result); | 35 void selectedRange(const CppArgumentList& args, CppVariant* result); |
| 34 void firstRectForCharacterRange(const CppArgumentList& args, CppVariant* resul
t); | 36 void firstRectForCharacterRange(const CppArgumentList& args, CppVariant* resul
t); |
| 35 void characterIndexForPoint(const CppArgumentList& args, CppVariant* result); | 37 void characterIndexForPoint(const CppArgumentList& args, CppVariant* result); |
| 36 void validAttributesForMarkedText(const CppArgumentList& args, CppVariant* res
ult); | 38 void validAttributesForMarkedText(const CppArgumentList& args, CppVariant* res
ult); |
| 37 void makeAttributedString(const CppArgumentList& args, CppVariant* result); | 39 void makeAttributedString(const CppArgumentList& args, CppVariant* result); |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 static WebTextInput* GetTextInput(); | 42 // Returns the test shell's main WebFrame. |
| 41 | 43 static WebKit::WebFrame* GetMainFrame(); |
| 42 // Returns the test shell's webview. | |
| 43 static WebView* webview(); | |
| 44 | 44 |
| 45 // Non-owning pointer. The LayoutTestController is owned by the host. | 45 // Non-owning pointer. The LayoutTestController is owned by the host. |
| 46 static TestShell* shell_; | 46 static TestShell* shell_; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 #endif // WEBKIT_TOOLS_TEST_SHELL_TEXT_INPUT_CONTROLLER_H__ | 49 #endif // WEBKIT_TOOLS_TEST_SHELL_TEXT_INPUT_CONTROLLER_H__ |
| OLD | NEW |