summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/test_native_handler.cc
blob: 31e7dcb9d75abf52846ddf67d60d9d5379085347 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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