OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/cpp/instance.h" | 5 #include "ppapi/cpp/instance.h" |
6 | 6 |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/c/ppb_input_event.h" | 8 #include "ppapi/c/ppb_input_event.h" |
9 #include "ppapi/c/ppb_instance.h" | 9 #include "ppapi/c/ppb_instance.h" |
10 #include "ppapi/c/ppb_messaging.h" | 10 #include "ppapi/c/ppb_messaging.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 | 72 |
73 bool Instance::HandleInputEvent(const InputEvent& /*event*/) { | 73 bool Instance::HandleInputEvent(const InputEvent& /*event*/) { |
74 return false; | 74 return false; |
75 } | 75 } |
76 | 76 |
77 void Instance::HandleMessage(const Var& /*message*/) { | 77 void Instance::HandleMessage(const Var& /*message*/) { |
78 return; | 78 return; |
79 } | 79 } |
80 | 80 |
81 #ifndef PPAPI_INSTANCE_REMOVE_SCRIPTING | |
82 Var Instance::GetWindowObject() { | |
83 if (!has_interface<PPB_Instance>()) | |
84 return Var(); | |
85 return Var(Var::PassRef(), | |
86 get_interface<PPB_Instance>()->GetWindowObject(pp_instance())); | |
87 } | |
88 | |
89 Var Instance::GetOwnerElementObject() { | |
90 if (!has_interface<PPB_Instance>()) | |
91 return Var(); | |
92 return Var(Var::PassRef(), | |
93 get_interface<PPB_Instance>()->GetOwnerElementObject( | |
94 pp_instance())); | |
95 } | |
96 | |
97 Var Instance::ExecuteScript(const Var& script, Var* exception) { | |
98 if (!has_interface<PPB_Instance>()) | |
99 return Var(); | |
100 return Var(Var::PassRef(), | |
101 get_interface<PPB_Instance>()->ExecuteScript( | |
102 pp_instance(), | |
103 script.pp_var(), | |
104 Var::OutException(exception).get())); | |
105 } | |
106 | |
107 Var Instance::GetInstanceObject() { | |
108 return Var(); | |
109 } | |
110 #endif | |
111 | |
112 bool Instance::BindGraphics(const Graphics2D& graphics) { | 81 bool Instance::BindGraphics(const Graphics2D& graphics) { |
113 if (!has_interface<PPB_Instance>()) | 82 if (!has_interface<PPB_Instance>()) |
114 return false; | 83 return false; |
115 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( | 84 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( |
116 pp_instance(), graphics.pp_resource())); | 85 pp_instance(), graphics.pp_resource())); |
117 } | 86 } |
118 | 87 |
119 bool Instance::BindGraphics(const Surface3D_Dev& graphics) { | 88 bool Instance::BindGraphics(const Surface3D_Dev& graphics) { |
120 if (!has_interface<PPB_Instance>()) | 89 if (!has_interface<PPB_Instance>()) |
121 return false; | 90 return false; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if (!that) | 160 if (!that) |
192 return NULL; | 161 return NULL; |
193 InterfaceNameToObjectMap::iterator found = | 162 InterfaceNameToObjectMap::iterator found = |
194 that->interface_name_to_objects_.find(interface_name); | 163 that->interface_name_to_objects_.find(interface_name); |
195 if (found == that->interface_name_to_objects_.end()) | 164 if (found == that->interface_name_to_objects_.end()) |
196 return NULL; | 165 return NULL; |
197 return found->second; | 166 return found->second; |
198 } | 167 } |
199 | 168 |
200 } // namespace pp | 169 } // namespace pp |
OLD | NEW |