| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dev/ppp_printing_dev.h" | 7 #include "ppapi/c/dev/ppp_printing_dev.h" |
| 8 #include "ppapi/c/ppb_instance.h" | 8 #include "ppapi/c/ppb_instance.h" |
| 9 #include "ppapi/cpp/common.h" |
| 9 #include "ppapi/cpp/dev/scrollbar_dev.h" | 10 #include "ppapi/cpp/dev/scrollbar_dev.h" |
| 10 #include "ppapi/cpp/dev/widget_dev.h" | 11 #include "ppapi/cpp/dev/widget_dev.h" |
| 11 #include "ppapi/cpp/graphics_2d.h" | 12 #include "ppapi/cpp/graphics_2d.h" |
| 12 #include "ppapi/cpp/image_data.h" | 13 #include "ppapi/cpp/image_data.h" |
| 13 #include "ppapi/cpp/logging.h" | 14 #include "ppapi/cpp/logging.h" |
| 14 #include "ppapi/cpp/module.h" | 15 #include "ppapi/cpp/module.h" |
| 15 #include "ppapi/cpp/module_impl.h" | 16 #include "ppapi/cpp/module_impl.h" |
| 16 #include "ppapi/cpp/point.h" | 17 #include "ppapi/cpp/point.h" |
| 17 #include "ppapi/cpp/resource.h" | 18 #include "ppapi/cpp/resource.h" |
| 18 #include "ppapi/cpp/var.h" | 19 #include "ppapi/cpp/var.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 Var Instance::GetOwnerElementObject() { | 77 Var Instance::GetOwnerElementObject() { |
| 77 if (!ppb_instance_f) | 78 if (!ppb_instance_f) |
| 78 return Var(); | 79 return Var(); |
| 79 return Var(Var::PassRef(), | 80 return Var(Var::PassRef(), |
| 80 ppb_instance_f->GetOwnerElementObject(pp_instance())); | 81 ppb_instance_f->GetOwnerElementObject(pp_instance())); |
| 81 } | 82 } |
| 82 | 83 |
| 83 bool Instance::BindGraphics(const Graphics2D& graphics) { | 84 bool Instance::BindGraphics(const Graphics2D& graphics) { |
| 84 if (!ppb_instance_f) | 85 if (!ppb_instance_f) |
| 85 return false; | 86 return false; |
| 86 return ppb_instance_f->BindGraphics(pp_instance(), graphics.pp_resource()); | 87 return PPBoolToBool(ppb_instance_f->BindGraphics(pp_instance(), |
| 88 graphics.pp_resource())); |
| 87 } | 89 } |
| 88 | 90 |
| 89 bool Instance::IsFullFrame() { | 91 bool Instance::IsFullFrame() { |
| 90 if (!ppb_instance_f) | 92 if (!ppb_instance_f) |
| 91 return false; | 93 return false; |
| 92 return ppb_instance_f->IsFullFrame(pp_instance()); | 94 return PPBoolToBool(ppb_instance_f->IsFullFrame(pp_instance())); |
| 93 } | 95 } |
| 94 | 96 |
| 95 Var Instance::ExecuteScript(const Var& script, Var* exception) { | 97 Var Instance::ExecuteScript(const Var& script, Var* exception) { |
| 96 if (!ppb_instance_f) | 98 if (!ppb_instance_f) |
| 97 return Var(); | 99 return Var(); |
| 98 return Var(Var::PassRef(), | 100 return Var(Var::PassRef(), |
| 99 ppb_instance_f->ExecuteScript(pp_instance(), script.pp_var(), | 101 ppb_instance_f->ExecuteScript(pp_instance(), script.pp_var(), |
| 100 Var::OutException(exception).get())); | 102 Var::OutException(exception).get())); |
| 101 } | 103 } |
| 102 | 104 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 if (!that) | 136 if (!that) |
| 135 return NULL; | 137 return NULL; |
| 136 InterfaceNameToObjectMap::iterator found = | 138 InterfaceNameToObjectMap::iterator found = |
| 137 that->interface_name_to_objects_.find(interface_name); | 139 that->interface_name_to_objects_.find(interface_name); |
| 138 if (found == that->interface_name_to_objects_.end()) | 140 if (found == that->interface_name_to_objects_.end()) |
| 139 return NULL; | 141 return NULL; |
| 140 return found->second; | 142 return found->second; |
| 141 } | 143 } |
| 142 | 144 |
| 143 } // namespace pp | 145 } // namespace pp |
| OLD | NEW |