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

Side by Side Diff: content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc

Issue 10824272: Add a skeleton gamepad resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 3 months 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
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"
8 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h"
7 #include "ppapi/host/resource_host.h" 9 #include "ppapi/host/resource_host.h"
8 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
9 11
10 using ppapi::host::ResourceHost; 12 using ppapi::host::ResourceHost;
11 13
12 namespace content { 14 namespace content {
13 15
14 ContentBrowserPepperHostFactory::ContentBrowserPepperHostFactory( 16 ContentBrowserPepperHostFactory::ContentBrowserPepperHostFactory(
15 BrowserPpapiHostImpl* host) 17 BrowserPpapiHostImpl* host)
16 : host_(host) { 18 : host_(host) {
17 } 19 }
18 20
19 ContentBrowserPepperHostFactory::~ContentBrowserPepperHostFactory() { 21 ContentBrowserPepperHostFactory::~ContentBrowserPepperHostFactory() {
20 } 22 }
21 23
22 scoped_ptr<ResourceHost> ContentBrowserPepperHostFactory::CreateResourceHost( 24 scoped_ptr<ResourceHost> ContentBrowserPepperHostFactory::CreateResourceHost(
23 ppapi::host::PpapiHost* host, 25 ppapi::host::PpapiHost* host,
24 const ppapi::proxy::ResourceMessageCallParams& params, 26 const ppapi::proxy::ResourceMessageCallParams& params,
25 PP_Instance instance, 27 PP_Instance instance,
26 const IPC::Message& message) { 28 const IPC::Message& message) {
27 // TODO(brettw) implement hosts here. 29 DCHECK(host == host_->GetPpapiHost());
30
31 // Make sure the plugin is giving us a valid instance for this resource.
32 /* TODO(brettw) make this work. The browser should be aware of all valid
33 instances.
34 if (!host_->IsValidInstance(instance))
35 return scoped_ptr<ResourceHost>();
36 */
37
38 // Public interfaces with no permissions required.
39 switch (message.type()) {
40 case PpapiHostMsg_Gamepad_Create::ID:
41 return scoped_ptr<ResourceHost>(new PepperGamepadHost(
42 host_, instance, params.pp_resource()));
43 }
28 return scoped_ptr<ResourceHost>(); 44 return scoped_ptr<ResourceHost>();
29 } 45 }
30 46
31 } // namespace content 47 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698