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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/pepper/content_renderer_pepper_host_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_gamepad_host.h" 8 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h"
9 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h" 9 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h"
10 #include "content/browser/renderer_host/pepper/pepper_printing_host.h" 10 #include "content/browser/renderer_host/pepper/pepper_printing_host.h"
(...skipping 16 matching lines...) Expand all
27 ppapi::host::PpapiHost* host, 27 ppapi::host::PpapiHost* host,
28 const ppapi::proxy::ResourceMessageCallParams& params, 28 const ppapi::proxy::ResourceMessageCallParams& params,
29 PP_Instance instance, 29 PP_Instance instance,
30 const IPC::Message& message) { 30 const IPC::Message& message) {
31 DCHECK(host == host_->GetPpapiHost()); 31 DCHECK(host == host_->GetPpapiHost());
32 32
33 // Make sure the plugin is giving us a valid instance for this resource. 33 // Make sure the plugin is giving us a valid instance for this resource.
34 if (!host_->IsValidInstance(instance)) 34 if (!host_->IsValidInstance(instance))
35 return scoped_ptr<ResourceHost>(); 35 return scoped_ptr<ResourceHost>();
36 36
37 // Public interfaces with no permissions required. 37 // Public interfaces.
38 switch (message.type()) { 38 switch (message.type()) {
39 case PpapiHostMsg_Gamepad_Create::ID: 39 case PpapiHostMsg_Gamepad_Create::ID:
40 return scoped_ptr<ResourceHost>(new PepperGamepadHost( 40 return scoped_ptr<ResourceHost>(new PepperGamepadHost(
41 host_, instance, params.pp_resource())); 41 host_, instance, params.pp_resource()));
42 case PpapiHostMsg_Printing_Create::ID: { 42 }
43 scoped_ptr<PepperPrintSettingsManager> manager( 43
44 new PepperPrintSettingsManagerImpl()); 44 // Dev interfaces.
45 return scoped_ptr<ResourceHost>(new PepperPrintingHost( 45 if (host_->GetPpapiHost()->permissions().HasPermission(
46 host_->GetPpapiHost(), instance, 46 ppapi::PERMISSION_DEV)) {
47 params.pp_resource(), manager.Pass())); 47 switch (message.type()) {
48 case PpapiHostMsg_Printing_Create::ID: {
49 scoped_ptr<PepperPrintSettingsManager> manager(
50 new PepperPrintSettingsManagerImpl());
51 return scoped_ptr<ResourceHost>(new PepperPrintingHost(
52 host_->GetPpapiHost(), instance,
53 params.pp_resource(), manager.Pass()));
54 }
48 } 55 }
49 } 56 }
50 return scoped_ptr<ResourceHost>(); 57 return scoped_ptr<ResourceHost>();
51 } 58 }
52 59
53 } // namespace content 60 } // namespace content
OLDNEW
« 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