| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "ppapi/shared_impl/api_id.h" | 12 #include "ppapi/shared_impl/api_id.h" |
| 13 #include "ppapi/shared_impl/function_group_base.h" | 13 #include "ppapi/shared_impl/function_group_base.h" |
| 14 #include "ppapi/shared_impl/id_assignment.h" | 14 #include "ppapi/shared_impl/id_assignment.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
| 21 #include "webkit/plugins/ppapi/plugin_module.h" | 21 #include "webkit/plugins/ppapi/plugin_module.h" |
| 22 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 22 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 23 #include "webkit/plugins/ppapi/ppb_cursor_control_impl.h" | |
| 24 #include "webkit/plugins/ppapi/ppb_flash_clipboard_impl.h" | 23 #include "webkit/plugins/ppapi/ppb_flash_clipboard_impl.h" |
| 25 #include "webkit/plugins/ppapi/ppb_text_input_impl.h" | 24 #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 |
| (...skipping 100 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_CURSORCONTROL: | |
| 145 proxy.reset(new PPB_CursorControl_Impl(instance)); | |
| 146 break; | |
| 147 case ::ppapi::API_ID_PPB_TEXT_INPUT: | 143 case ::ppapi::API_ID_PPB_TEXT_INPUT: |
| 148 proxy.reset(new PPB_TextInput_Impl(instance)); | 144 proxy.reset(new PPB_TextInput_Impl(instance)); |
| 149 break; | 145 break; |
| 150 case ::ppapi::API_ID_RESOURCE_CREATION: | 146 case ::ppapi::API_ID_RESOURCE_CREATION: |
| 151 proxy.reset(new ResourceCreationImpl(instance)); | 147 proxy.reset(new ResourceCreationImpl(instance)); |
| 152 break; | 148 break; |
| 153 case ::ppapi::API_ID_PPB_FLASH_CLIPBOARD: | 149 case ::ppapi::API_ID_PPB_FLASH_CLIPBOARD: |
| 154 proxy.reset(new PPB_Flash_Clipboard_Impl(instance)); | 150 proxy.reset(new PPB_Flash_Clipboard_Impl(instance)); |
| 155 break; | 151 break; |
| 156 default: | 152 default: |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 return NULL; | 286 return NULL; |
| 291 return found->second->instance; | 287 return found->second->instance; |
| 292 } | 288 } |
| 293 | 289 |
| 294 bool HostGlobals::IsHostGlobals() const { | 290 bool HostGlobals::IsHostGlobals() const { |
| 295 return true; | 291 return true; |
| 296 } | 292 } |
| 297 | 293 |
| 298 } // namespace ppapi | 294 } // namespace ppapi |
| 299 } // namespace webkit | 295 } // namespace webkit |
| OLD | NEW |