| 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/renderer/pepper/content_renderer_pepper_host_factory.h" | 5 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/renderer/pepper/pepper_file_chooser_host.h" | 8 #include "content/renderer/pepper/pepper_file_chooser_host.h" |
| 9 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 9 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| 10 #include "ppapi/host/resource_host.h" | 10 #include "ppapi/host/resource_host.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 DCHECK(host == host_->GetPpapiHost()); | 30 DCHECK(host == host_->GetPpapiHost()); |
| 31 | 31 |
| 32 // Make sure the plugin is giving us a valid instance for this resource. | 32 // Make sure the plugin is giving us a valid instance for this resource. |
| 33 if (!host_->IsValidInstance(instance)) | 33 if (!host_->IsValidInstance(instance)) |
| 34 return scoped_ptr<ResourceHost>(); | 34 return scoped_ptr<ResourceHost>(); |
| 35 | 35 |
| 36 // Resources for dev interfaces. | 36 // Resources for dev interfaces. |
| 37 // TODO(brettw) when we support any public or private interfaces, put them in | 37 // TODO(brettw) when we support any public or private interfaces, put them in |
| 38 // a separate switch above. | 38 // a separate switch above. |
| 39 | 39 |
| 40 // TODO(brettw) put back this dev check! This was removed to fix issue 138902 | 40 // TODO(brettw) bug 147507: put back this dev check and remove the log! This |
| 41 // where the permissions for bundled Flash (but not Flash that you specify | 41 // was removed to fix issue 138902 where the permissions for bundled Flash |
| 42 // on the command line, making it difficult to test) are incorrect. | 42 // (but not Flash that you specify on the command line, making it difficult |
| 43 // to test) are incorrect. |
| 44 LOG(INFO) << "ContentRendererPepperHostFactory::CreateResourceHost " |
| 45 << "permissions = " << GetPermissions().GetBits(); |
| 43 /*if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV))*/ { | 46 /*if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV))*/ { |
| 44 switch (message.type()) { | 47 switch (message.type()) { |
| 45 case PpapiHostMsg_FileChooser_Create::ID: | 48 case PpapiHostMsg_FileChooser_Create::ID: |
| 46 return scoped_ptr<ResourceHost>(new PepperFileChooserHost( | 49 return scoped_ptr<ResourceHost>(new PepperFileChooserHost( |
| 47 host_, instance, params.pp_resource())); | 50 host_, instance, params.pp_resource())); |
| 48 } | 51 } |
| 49 } | 52 } |
| 50 return scoped_ptr<ResourceHost>(); | 53 return scoped_ptr<ResourceHost>(); |
| 51 } | 54 } |
| 52 | 55 |
| 53 const ppapi::PpapiPermissions& | 56 const ppapi::PpapiPermissions& |
| 54 ContentRendererPepperHostFactory::GetPermissions() const { | 57 ContentRendererPepperHostFactory::GetPermissions() const { |
| 55 return host_->GetPpapiHost()->permissions(); | 58 return host_->GetPpapiHost()->permissions(); |
| 56 } | 59 } |
| 57 | 60 |
| 58 } // namespace content | 61 } // namespace content |
| OLD | NEW |