| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/plugins/ppapi/host_globals.h" | 5 #include "webkit/plugins/ppapi/host_globals.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "ppapi/shared_impl/api_id.h" | 13 #include "ppapi/shared_impl/api_id.h" |
| 14 #include "ppapi/shared_impl/function_group_base.h" | 14 #include "ppapi/shared_impl/function_group_base.h" |
| 15 #include "ppapi/shared_impl/id_assignment.h" | 15 #include "ppapi/shared_impl/id_assignment.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
| 22 #include "webkit/plugins/plugin_switches.h" | 22 #include "webkit/plugins/plugin_switches.h" |
| 23 #include "webkit/plugins/ppapi/plugin_module.h" | 23 #include "webkit/plugins/ppapi/plugin_module.h" |
| 24 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 24 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 25 #include "webkit/plugins/ppapi/ppb_text_input_impl.h" | |
| 26 #include "webkit/plugins/ppapi/resource_creation_impl.h" | 25 #include "webkit/plugins/ppapi/resource_creation_impl.h" |
| 27 | 26 |
| 28 using ppapi::CheckIdType; | 27 using ppapi::CheckIdType; |
| 29 using ppapi::MakeTypedId; | 28 using ppapi::MakeTypedId; |
| 30 using ppapi::PPIdType; | 29 using ppapi::PPIdType; |
| 31 using WebKit::WebConsoleMessage; | 30 using WebKit::WebConsoleMessage; |
| 32 using WebKit::WebString; | 31 using WebKit::WebString; |
| 33 | 32 |
| 34 namespace webkit { | 33 namespace webkit { |
| 35 namespace ppapi { | 34 namespace ppapi { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // object. | 133 // object. |
| 135 if (id == ::ppapi::API_ID_PPB_INSTANCE) | 134 if (id == ::ppapi::API_ID_PPB_INSTANCE) |
| 136 return instance; | 135 return instance; |
| 137 | 136 |
| 138 scoped_ptr< ::ppapi::FunctionGroupBase >& proxy = | 137 scoped_ptr< ::ppapi::FunctionGroupBase >& proxy = |
| 139 instance_map_[pp_instance]->function_proxies[id]; | 138 instance_map_[pp_instance]->function_proxies[id]; |
| 140 if (proxy.get()) | 139 if (proxy.get()) |
| 141 return proxy.get(); | 140 return proxy.get(); |
| 142 | 141 |
| 143 switch (id) { | 142 switch (id) { |
| 144 case ::ppapi::API_ID_PPB_TEXT_INPUT: | |
| 145 proxy.reset(new PPB_TextInput_Impl(instance)); | |
| 146 break; | |
| 147 case ::ppapi::API_ID_RESOURCE_CREATION: | 143 case ::ppapi::API_ID_RESOURCE_CREATION: |
| 148 proxy.reset(new ResourceCreationImpl(instance)); | 144 proxy.reset(new ResourceCreationImpl(instance)); |
| 149 break; | 145 break; |
| 150 default: | 146 default: |
| 151 NOTREACHED(); | 147 NOTREACHED(); |
| 152 } | 148 } |
| 153 | 149 |
| 154 return proxy.get(); | 150 return proxy.get(); |
| 155 } | 151 } |
| 156 | 152 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 return NULL; | 289 return NULL; |
| 294 return found->second->instance; | 290 return found->second->instance; |
| 295 } | 291 } |
| 296 | 292 |
| 297 bool HostGlobals::IsHostGlobals() const { | 293 bool HostGlobals::IsHostGlobals() const { |
| 298 return true; | 294 return true; |
| 299 } | 295 } |
| 300 | 296 |
| 301 } // namespace ppapi | 297 } // namespace ppapi |
| 302 } // namespace webkit | 298 } // namespace webkit |
| OLD | NEW |