Currently, bionic only build a subset of the examples. This changes turns on all...
[chromium-blink-merge.git] / mojo / examples / pepper_container_app / interface_list.cc
blob7f4d2ea613a69473fd8c82f6b6c0b50f417ca322
1 // Copyright 2014 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 "mojo/examples/pepper_container_app/interface_list.h"
7 #include "base/memory/singleton.h"
8 #include "mojo/examples/pepper_container_app/thunk.h"
9 #include "ppapi/c/ppb_core.h"
10 #include "ppapi/c/ppb_graphics_3d.h"
11 #include "ppapi/c/ppb_instance.h"
12 #include "ppapi/c/ppb_opengles2.h"
13 #include "ppapi/c/ppb_view.h"
14 #include "ppapi/thunk/thunk.h"
16 namespace mojo {
17 namespace examples {
19 InterfaceList::InterfaceList() {
20 browser_interfaces_[PPB_CORE_INTERFACE_1_0] = GetPPB_Core_1_0_Thunk();
21 browser_interfaces_[PPB_GRAPHICS_3D_INTERFACE_1_0] =
22 ppapi::thunk::GetPPB_Graphics3D_1_0_Thunk();
23 browser_interfaces_[PPB_OPENGLES2_INTERFACE_1_0] =
24 GetPPB_OpenGLES2_Thunk();
25 browser_interfaces_[PPB_INSTANCE_INTERFACE_1_0] =
26 ppapi::thunk::GetPPB_Instance_1_0_Thunk();
27 browser_interfaces_[PPB_VIEW_INTERFACE_1_0] =
28 ppapi::thunk::GetPPB_View_1_0_Thunk();
29 browser_interfaces_[PPB_VIEW_INTERFACE_1_1] =
30 ppapi::thunk::GetPPB_View_1_1_Thunk();
33 InterfaceList::~InterfaceList() {}
35 // static
36 InterfaceList* InterfaceList::GetInstance() {
37 return Singleton<InterfaceList>::get();
40 const void* InterfaceList::GetBrowserInterface(const std::string& name) const {
41 NameToInterfaceMap::const_iterator iter = browser_interfaces_.find(name);
43 if (iter == browser_interfaces_.end())
44 return NULL;
46 return iter->second;
49 } // namespace examples
50 } // namespace mojo