summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/test_native_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/renderer/test_native_handler.cc')
-rw-r--r--extensions/renderer/test_native_handler.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/extensions/renderer/test_native_handler.cc b/extensions/renderer/test_native_handler.cc
new file mode 100644
index 0000000..31e7dcb
--- /dev/null
+++ b/extensions/renderer/test_native_handler.cc
@@ -0,0 +1,24 @@
+// Copyright 2015 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.
+
+#include "extensions/renderer/test_native_handler.h"
+
+#include "extensions/renderer/wake_event_page.h"
+
+namespace extensions {
+
+TestNativeHandler::TestNativeHandler(ScriptContext* context)
+ : ObjectBackedNativeHandler(context) {
+ RouteFunction(
+ "GetWakeEventPage",
+ base::Bind(&TestNativeHandler::GetWakeEventPage, base::Unretained(this)));
+}
+
+void TestNativeHandler::GetWakeEventPage(
+ const v8::FunctionCallbackInfo<v8::Value>& args) {
+ CHECK_EQ(0, args.Length());
+ args.GetReturnValue().Set(WakeEventPage::Get()->GetForContext(context()));
+}
+
+} // namespace extensions