ExtensionInstallDialogView: fix scrolling behavior on Views (Win,Linux)
[chromium-blink-merge.git] / remoting / client / plugin / pepper_entrypoints.cc
blobf6086c36cf0fe3203b79b8847f2659628066a065
1 // Copyright (c) 2011 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.
5 #include "remoting/client/plugin/pepper_entrypoints.h"
7 #include "base/message_loop/message_loop.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/pp_instance.h"
10 #include "ppapi/c/pp_module.h"
11 #include "ppapi/c/ppb_instance.h"
12 #include "ppapi/cpp/instance.h"
13 #include "ppapi/cpp/module.h"
14 #include "ppapi/cpp/private/internal_module.h"
15 #include "remoting/client/plugin/chromoting_instance.h"
17 namespace remoting {
19 class ChromotingModule : public pp::Module {
20 protected:
21 ChromotingInstance* CreateInstance(PP_Instance instance) override {
22 return new ChromotingInstance(instance);
26 // Implementation of Global PPP functions ---------------------------------
27 int32_t PPP_InitializeModule(PP_Module module_id,
28 PPB_GetInterface get_browser_interface) {
29 ChromotingModule* module = new ChromotingModule();
30 if (!module->InternalInit(module_id, get_browser_interface)) {
31 delete module;
32 return PP_ERROR_FAILED;
35 #if !defined(NDEBUG)
36 // Register a global log handler, but only in Debug builds.
37 ChromotingInstance::RegisterLogMessageHandler();
38 #endif
40 pp::InternalSetModuleSingleton(module);
41 return PP_OK;
44 void PPP_ShutdownModule() {
45 delete pp::Module::Get();
46 pp::InternalSetModuleSingleton(nullptr);
49 const void* PPP_GetInterface(const char* interface_name) {
50 if (!pp::Module::Get())
51 return nullptr;
52 return pp::Module::Get()->GetPluginInterface(interface_name);
55 const void* PPP_GetBrowserInterface(const char* interface_name) {
56 if (!pp::Module::Get())
57 return nullptr;
58 return pp::Module::Get()->GetBrowserInterface(interface_name);
61 } // namespace remoting