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 "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory
.h" | 5 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory
.h" |
6 | 6 |
| 7 #include "chrome/browser/renderer_host/pepper/pepper_broker_host.h" |
7 #include "chrome/browser/renderer_host/pepper/pepper_flash_device_id_host.h" | 8 #include "chrome/browser/renderer_host/pepper/pepper_flash_device_id_host.h" |
8 #include "chrome/browser/renderer_host/pepper/pepper_talk_host.h" | 9 #include "chrome/browser/renderer_host/pepper/pepper_talk_host.h" |
9 #include "content/public/browser/browser_ppapi_host.h" | 10 #include "content/public/browser/browser_ppapi_host.h" |
10 #include "ppapi/host/ppapi_host.h" | 11 #include "ppapi/host/ppapi_host.h" |
11 #include "ppapi/host/resource_host.h" | 12 #include "ppapi/host/resource_host.h" |
12 #include "ppapi/proxy/ppapi_messages.h" | 13 #include "ppapi/proxy/ppapi_messages.h" |
13 #include "ppapi/shared_impl/ppapi_permissions.h" | 14 #include "ppapi/shared_impl/ppapi_permissions.h" |
14 | 15 |
15 using ppapi::host::ResourceHost; | 16 using ppapi::host::ResourceHost; |
16 | 17 |
(...skipping 15 matching lines...) Expand all Loading... |
32 DCHECK(host == host_->GetPpapiHost()); | 33 DCHECK(host == host_->GetPpapiHost()); |
33 | 34 |
34 // Make sure the plugin is giving us a valid instance for this resource. | 35 // Make sure the plugin is giving us a valid instance for this resource. |
35 if (!host_->IsValidInstance(instance)) | 36 if (!host_->IsValidInstance(instance)) |
36 return scoped_ptr<ResourceHost>(); | 37 return scoped_ptr<ResourceHost>(); |
37 | 38 |
38 // Private interfaces. | 39 // Private interfaces. |
39 if (host_->GetPpapiHost()->permissions().HasPermission( | 40 if (host_->GetPpapiHost()->permissions().HasPermission( |
40 ppapi::PERMISSION_PRIVATE)) { | 41 ppapi::PERMISSION_PRIVATE)) { |
41 switch (message.type()) { | 42 switch (message.type()) { |
| 43 case PpapiHostMsg_Broker_Create::ID: |
| 44 return scoped_ptr<ResourceHost>(new PepperBrokerHost( |
| 45 host_, instance, params.pp_resource())); |
42 case PpapiHostMsg_FlashDeviceID_Create::ID: | 46 case PpapiHostMsg_FlashDeviceID_Create::ID: |
43 return scoped_ptr<ResourceHost>(new PepperFlashDeviceIDHost( | 47 return scoped_ptr<ResourceHost>(new PepperFlashDeviceIDHost( |
44 host_, instance, params.pp_resource())); | 48 host_, instance, params.pp_resource())); |
45 case PpapiHostMsg_Talk_Create::ID: | 49 case PpapiHostMsg_Talk_Create::ID: |
46 return scoped_ptr<ResourceHost>(new PepperTalkHost( | 50 return scoped_ptr<ResourceHost>(new PepperTalkHost( |
47 host_, instance, params.pp_resource())); | 51 host_, instance, params.pp_resource())); |
48 } | 52 } |
49 } | 53 } |
50 return scoped_ptr<ResourceHost>(); | 54 return scoped_ptr<ResourceHost>(); |
51 } | 55 } |
52 | 56 |
53 } // namespace chrome | 57 } // namespace chrome |
OLD | NEW |