Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Unified Diff: content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc

Issue 11365235: Add PPAPI permissions for file chooser, PDF, testing, video capture, and video decode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/pepper/content_renderer_pepper_host_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc
diff --git a/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc b/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc
index eb325fd21e8c185daf0f68d21d59039b4963b018..a814cefd605c782f7e0f54df9d415077f29f38da 100644
--- a/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc
+++ b/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc
@@ -34,17 +34,24 @@ scoped_ptr<ResourceHost> ContentBrowserPepperHostFactory::CreateResourceHost(
if (!host_->IsValidInstance(instance))
return scoped_ptr<ResourceHost>();
- // Public interfaces with no permissions required.
+ // Public interfaces.
switch (message.type()) {
case PpapiHostMsg_Gamepad_Create::ID:
return scoped_ptr<ResourceHost>(new PepperGamepadHost(
host_, instance, params.pp_resource()));
- case PpapiHostMsg_Printing_Create::ID: {
- scoped_ptr<PepperPrintSettingsManager> manager(
- new PepperPrintSettingsManagerImpl());
- return scoped_ptr<ResourceHost>(new PepperPrintingHost(
- host_->GetPpapiHost(), instance,
- params.pp_resource(), manager.Pass()));
+ }
+
+ // Dev interfaces.
+ if (host_->GetPpapiHost()->permissions().HasPermission(
+ ppapi::PERMISSION_DEV)) {
+ switch (message.type()) {
+ case PpapiHostMsg_Printing_Create::ID: {
+ scoped_ptr<PepperPrintSettingsManager> manager(
+ new PepperPrintSettingsManagerImpl());
+ return scoped_ptr<ResourceHost>(new PepperPrintingHost(
+ host_->GetPpapiHost(), instance,
+ params.pp_resource(), manager.Pass()));
+ }
}
}
return scoped_ptr<ResourceHost>();
« no previous file with comments | « no previous file | content/renderer/pepper/content_renderer_pepper_host_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698