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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_gamepad_host.h

Issue 2563483006: Move gamepad_service out of content/ and into device/ (Closed)
Patch Set: addressed Blundell's review comments Created 4 years 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
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_GAMEPAD_HOST_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_GAMEPAD_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_GAMEPAD_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_GAMEPAD_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 #include "device/gamepad/gamepad_consumer.h" 14 #include "device/gamepad/gamepad_consumer.h"
15 #include "ppapi/host/resource_host.h" 15 #include "ppapi/host/resource_host.h"
16 16
17 namespace device {
18 class GamepadService;
19 }
20
17 namespace ppapi { 21 namespace ppapi {
18 namespace host { 22 namespace host {
19 struct ReplyMessageContext; 23 struct ReplyMessageContext;
20 } 24 }
21 } 25 }
22 26
23 namespace content { 27 namespace content {
24 28
25 class BrowserPpapiHost; 29 class BrowserPpapiHost;
26 class GamepadService;
27 30
28 class CONTENT_EXPORT PepperGamepadHost : 31 class CONTENT_EXPORT PepperGamepadHost :
29 public ppapi::host::ResourceHost, 32 public ppapi::host::ResourceHost,
30 public device::GamepadConsumer { 33 public device::GamepadConsumer {
31 public: 34 public:
32 PepperGamepadHost(BrowserPpapiHost* host, 35 PepperGamepadHost(BrowserPpapiHost* host,
33 PP_Instance instance, 36 PP_Instance instance,
34 PP_Resource resource); 37 PP_Resource resource);
35 38
36 // Allows tests to specify a gamepad service to use rather than the global 39 // Allows tests to specify a gamepad service to use rather than the global
37 // singleton. The caller owns the gamepad_service pointer. 40 // singleton. The caller owns the gamepad_service pointer.
38 PepperGamepadHost(GamepadService* gamepad_service, 41 PepperGamepadHost(device::GamepadService* gamepad_service,
39 BrowserPpapiHost* host, 42 BrowserPpapiHost* host,
40 PP_Instance instance, 43 PP_Instance instance,
41 PP_Resource resource); 44 PP_Resource resource);
42 45
43 ~PepperGamepadHost() override; 46 ~PepperGamepadHost() override;
44 47
45 int32_t OnResourceMessageReceived( 48 int32_t OnResourceMessageReceived(
46 const IPC::Message& msg, 49 const IPC::Message& msg,
47 ppapi::host::HostMessageContext* context) override; 50 ppapi::host::HostMessageContext* context) override;
48 51
49 // GamepadConsumer implementation. 52 // GamepadConsumer implementation.
50 void OnGamepadConnected(unsigned index, 53 void OnGamepadConnected(unsigned index,
51 const blink::WebGamepad& gamepad) override {} 54 const blink::WebGamepad& gamepad) override {}
52 void OnGamepadDisconnected(unsigned index, 55 void OnGamepadDisconnected(unsigned index,
53 const blink::WebGamepad& gamepad) override {} 56 const blink::WebGamepad& gamepad) override {}
54 57
55 private: 58 private:
56 int32_t OnRequestMemory(ppapi::host::HostMessageContext* context); 59 int32_t OnRequestMemory(ppapi::host::HostMessageContext* context);
57 60
58 void GotUserGesture(const ppapi::host::ReplyMessageContext& in_context); 61 void GotUserGesture(const ppapi::host::ReplyMessageContext& in_context);
59 62
60 BrowserPpapiHost* browser_ppapi_host_; 63 BrowserPpapiHost* browser_ppapi_host_;
61 64
62 GamepadService* gamepad_service_; 65 device::GamepadService* gamepad_service_;
63 66
64 bool is_started_; 67 bool is_started_;
65 68
66 base::WeakPtrFactory<PepperGamepadHost> weak_factory_; 69 base::WeakPtrFactory<PepperGamepadHost> weak_factory_;
67 70
68 DISALLOW_COPY_AND_ASSIGN(PepperGamepadHost); 71 DISALLOW_COPY_AND_ASSIGN(PepperGamepadHost);
69 }; 72 };
70 73
71 } // namespace content 74 } // namespace content
72 75
73 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_GAMEPAD_HOST_H_ 76 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_GAMEPAD_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/gamepad_monitor.cc ('k') | content/browser/renderer_host/pepper/pepper_gamepad_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698