diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 20:36:41 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 20:36:41 +0000 |
commit | e13284d0688fd1113c9e8cd51304df3b81d2b395 (patch) | |
tree | 15a428b496decbc6a01853d38aed385d6eb95c5d /content/browser/renderer_host/pepper | |
parent | ea1a3f60aa4527939af680eda25c7697901f643c (diff) | |
download | chromium_src-e13284d0688fd1113c9e8cd51304df3b81d2b395.zip chromium_src-e13284d0688fd1113c9e8cd51304df3b81d2b395.tar.gz chromium_src-e13284d0688fd1113c9e8cd51304df3b81d2b395.tar.bz2 |
Merge branch 'master' into perms_print
Hook up PPAPI permissions to the printing interfaces
This is a reland of part of r167727.
Original review URL: https://codereview.chromium.org/11365235
R=raymes
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168282 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/pepper')
-rw-r--r-- | content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc | 21 |
1 files changed, 14 insertions, 7 deletions
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 eb325fd..b66ff88 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>(); |