summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/plain_text_controller.h
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/tools/test_shell/plain_text_controller.h')
-rw-r--r--webkit/tools/test_shell/plain_text_controller.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/plain_text_controller.h b/webkit/tools/test_shell/plain_text_controller.h
new file mode 100644
index 0000000..737b275
--- /dev/null
+++ b/webkit/tools/test_shell/plain_text_controller.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2006-2009 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.
+
+// PlainTextController class:
+// Bound to a JavaScript window.plainText object using
+// CppBoundClass::BindToJavascript(), this allows layout tests that are run in
+// the test_shell to extract plain text from the DOM or the selection.
+//
+// The OSX reference file is in
+// WebKit/WebKitTools/DumpRenderTree/PlainTextController.mm
+
+#ifndef WEBKIT_TOOLS_TEST_SHELL_PLAIN_TEXT_CONTROLLER_H_
+#define WEBKIT_TOOLS_TEST_SHELL_PLAIN_TEXT_CONTROLLER_H_
+
+#include "build/build_config.h"
+#include "webkit/glue/cpp_bound_class.h"
+
+class TestShell;
+
+class PlainTextController : public CppBoundClass {
+ public:
+ // Builds the property and method lists needed to bind this class to a JS
+ // object.
+ explicit PlainTextController(TestShell* shell);
+
+ // JS callback methods.
+ void plainText(const CppArgumentList& args, CppVariant* result);
+
+ // Fall-back method: called if an unknown method is invoked.
+ void fallbackMethod(const CppArgumentList& args, CppVariant* result);
+
+ private:
+ // Non-owning pointer. The LayoutTestController is owned by the host.
+ static TestShell* shell_;
+};
+
+#endif // WEBKIT_TOOLS_TEST_SHELL_PLAIN_TEXT_CONTROLLER_H_
+