| 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 "content/browser/renderer_host/pepper/content_browser_pepper_host_facto
ry.h" | 5 #include "content/browser/renderer_host/pepper/content_browser_pepper_host_facto
ry.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" | 7 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
| 8 #include "content/browser/renderer_host/pepper/pepper_browser_font_singleton_hos
t.h" |
| 8 #include "content/browser/renderer_host/pepper/pepper_flash_browser_host.h" | 9 #include "content/browser/renderer_host/pepper/pepper_flash_browser_host.h" |
| 9 #include "content/browser/renderer_host/pepper/pepper_flash_file_host.h" | 10 #include "content/browser/renderer_host/pepper/pepper_flash_file_host.h" |
| 10 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" | 11 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" |
| 11 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h" | 12 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h" |
| 12 #include "content/browser/renderer_host/pepper/pepper_printing_host.h" | 13 #include "content/browser/renderer_host/pepper/pepper_printing_host.h" |
| 13 #include "ppapi/host/resource_host.h" | 14 #include "ppapi/host/resource_host.h" |
| 14 #include "ppapi/proxy/ppapi_messages.h" | 15 #include "ppapi/proxy/ppapi_messages.h" |
| 15 #include "ppapi/shared_impl/ppapi_permissions.h" | 16 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 16 | 17 |
| 17 using ppapi::host::ResourceHost; | 18 using ppapi::host::ResourceHost; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 case PpapiHostMsg_Printing_Create::ID: { | 51 case PpapiHostMsg_Printing_Create::ID: { |
| 51 scoped_ptr<PepperPrintSettingsManager> manager( | 52 scoped_ptr<PepperPrintSettingsManager> manager( |
| 52 new PepperPrintSettingsManagerImpl()); | 53 new PepperPrintSettingsManagerImpl()); |
| 53 return scoped_ptr<ResourceHost>(new PepperPrintingHost( | 54 return scoped_ptr<ResourceHost>(new PepperPrintingHost( |
| 54 host_->GetPpapiHost(), instance, | 55 host_->GetPpapiHost(), instance, |
| 55 params.pp_resource(), manager.Pass())); | 56 params.pp_resource(), manager.Pass())); |
| 56 } | 57 } |
| 57 } | 58 } |
| 58 } | 59 } |
| 59 | 60 |
| 61 // Private interfaces. |
| 62 if (GetPermissions().HasPermission(ppapi::PERMISSION_PRIVATE)) { |
| 63 switch (message.type()) { |
| 64 case PpapiHostMsg_BrowserFontSingleton_Create::ID: |
| 65 return scoped_ptr<ResourceHost>(new PepperBrowserFontSingletonHost( |
| 66 host_, instance, params.pp_resource())); |
| 67 } |
| 68 } |
| 69 |
| 60 // Flash interfaces. | 70 // Flash interfaces. |
| 61 if (GetPermissions().HasPermission(ppapi::PERMISSION_FLASH)) { | 71 if (GetPermissions().HasPermission(ppapi::PERMISSION_FLASH)) { |
| 62 switch (message.type()) { | 72 switch (message.type()) { |
| 63 case PpapiHostMsg_Flash_Create::ID: | 73 case PpapiHostMsg_Flash_Create::ID: |
| 64 return scoped_ptr<ResourceHost>(new PepperFlashBrowserHost( | 74 return scoped_ptr<ResourceHost>(new PepperFlashBrowserHost( |
| 65 host_, instance, params.pp_resource())); | 75 host_, instance, params.pp_resource())); |
| 66 case PpapiHostMsg_FlashFile_Create::ID: | 76 case PpapiHostMsg_FlashFile_Create::ID: |
| 67 return scoped_ptr<ResourceHost>(new PepperFlashFileHost( | 77 return scoped_ptr<ResourceHost>(new PepperFlashFileHost( |
| 68 host_, instance, params.pp_resource())); | 78 host_, instance, params.pp_resource())); |
| 69 } | 79 } |
| 70 } | 80 } |
| 71 | 81 |
| 72 return scoped_ptr<ResourceHost>(); | 82 return scoped_ptr<ResourceHost>(); |
| 73 } | 83 } |
| 74 | 84 |
| 75 const ppapi::PpapiPermissions& | 85 const ppapi::PpapiPermissions& |
| 76 ContentBrowserPepperHostFactory::GetPermissions() const { | 86 ContentBrowserPepperHostFactory::GetPermissions() const { |
| 77 return host_->GetPpapiHost()->permissions(); | 87 return host_->GetPpapiHost()->permissions(); |
| 78 } | 88 } |
| 79 | 89 |
| 80 } // namespace content | 90 } // namespace content |
| OLD | NEW |