test_native_handler.h 1016 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef EXTENSIONS_RENDERER_TEST_NATIVE_HANDLER_H_
  5. #define EXTENSIONS_RENDERER_TEST_NATIVE_HANDLER_H_
  6. #include "base/compiler_specific.h"
  7. #include "extensions/renderer/object_backed_native_handler.h"
  8. #include "v8/include/v8-forward.h"
  9. #include "v8/include/v8-function-callback.h"
  10. namespace extensions {
  11. class ScriptContext;
  12. // NativeHandler for the chrome.test API.
  13. class TestNativeHandler : public ObjectBackedNativeHandler {
  14. public:
  15. explicit TestNativeHandler(ScriptContext* context);
  16. TestNativeHandler(const TestNativeHandler&) = delete;
  17. TestNativeHandler& operator=(const TestNativeHandler&) = delete;
  18. // ObjectBackedNativeHandler:
  19. void AddRoutes() override;
  20. private:
  21. void GetWakeEventPage(const v8::FunctionCallbackInfo<v8::Value>& args);
  22. };
  23. } // namespace extensions
  24. #endif // EXTENSIONS_RENDERER_TEST_NATIVE_HANDLER_H_