| 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_flash_clipboard_impl.h" | |
| 26 #include "webkit/plugins/ppapi/ppb_text_input_impl.h" | 25 #include "webkit/plugins/ppapi/ppb_text_input_impl.h" |
| 27 #include "webkit/plugins/ppapi/resource_creation_impl.h" | 26 #include "webkit/plugins/ppapi/resource_creation_impl.h" |
| 28 | 27 |
| 29 using ppapi::CheckIdType; | 28 using ppapi::CheckIdType; |
| 30 using ppapi::MakeTypedId; | 29 using ppapi::MakeTypedId; |
| 31 using ppapi::PPIdType; | 30 using ppapi::PPIdType; |
| 32 using WebKit::WebConsoleMessage; | 31 using WebKit::WebConsoleMessage; |
| 33 using WebKit::WebString; | 32 using WebKit::WebString; |
| 34 | 33 |
| 35 namespace webkit { | 34 namespace webkit { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 if (proxy.get()) | 140 if (proxy.get()) |
| 142 return proxy.get(); | 141 return proxy.get(); |
| 143 | 142 |
| 144 switch (id) { | 143 switch (id) { |
| 145 case ::ppapi::API_ID_PPB_TEXT_INPUT: | 144 case ::ppapi::API_ID_PPB_TEXT_INPUT: |
| 146 proxy.reset(new PPB_TextInput_Impl(instance)); | 145 proxy.reset(new PPB_TextInput_Impl(instance)); |
| 147 break; | 146 break; |
| 148 case ::ppapi::API_ID_RESOURCE_CREATION: | 147 case ::ppapi::API_ID_RESOURCE_CREATION: |
| 149 proxy.reset(new ResourceCreationImpl(instance)); | 148 proxy.reset(new ResourceCreationImpl(instance)); |
| 150 break; | 149 break; |
| 151 case ::ppapi::API_ID_PPB_FLASH_CLIPBOARD: | |
| 152 proxy.reset(new PPB_Flash_Clipboard_Impl(instance)); | |
| 153 break; | |
| 154 default: | 150 default: |
| 155 NOTREACHED(); | 151 NOTREACHED(); |
| 156 } | 152 } |
| 157 | 153 |
| 158 return proxy.get(); | 154 return proxy.get(); |
| 159 } | 155 } |
| 160 | 156 |
| 161 PP_Module HostGlobals::GetModuleForInstance(PP_Instance instance) { | 157 PP_Module HostGlobals::GetModuleForInstance(PP_Instance instance) { |
| 162 PluginInstance* inst = GetInstance(instance); | 158 PluginInstance* inst = GetInstance(instance); |
| 163 if (!inst) | 159 if (!inst) |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 return NULL; | 293 return NULL; |
| 298 return found->second->instance; | 294 return found->second->instance; |
| 299 } | 295 } |
| 300 | 296 |
| 301 bool HostGlobals::IsHostGlobals() const { | 297 bool HostGlobals::IsHostGlobals() const { |
| 302 return true; | 298 return true; |
| 303 } | 299 } |
| 304 | 300 |
| 305 } // namespace ppapi | 301 } // namespace ppapi |
| 306 } // namespace webkit | 302 } // namespace webkit |
| OLD | NEW |