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

Side by Side Diff: content/browser/gamepad/gamepad_service.h

Issue 2129003002: Refactored gamepad polling to support dynamic sources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test issue and Mac XBoxDataFetcher constructor Created 4 years, 5 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
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_GAMEPAD_GAMEPAD_SERVICE_H_ 5 #ifndef CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_
6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_ 6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 virtual ~GamepadService(); 99 virtual ~GamepadService();
100 100
101 static void SetInstance(GamepadService*); 101 static void SetInstance(GamepadService*);
102 102
103 void OnUserGesture(); 103 void OnUserGesture();
104 104
105 void OnGamepadConnectionChange(bool connected, 105 void OnGamepadConnectionChange(bool connected,
106 int index, 106 int index,
107 const blink::WebGamepad& pad) override; 107 const blink::WebGamepad& pad) override;
108 108
109 void SetSanitizationEnabled(bool sanitize);
110
109 struct ConsumerInfo { 111 struct ConsumerInfo {
110 ConsumerInfo(device::GamepadConsumer* consumer) 112 ConsumerInfo(device::GamepadConsumer* consumer)
111 : consumer(consumer), did_observe_user_gesture(false) {} 113 : consumer(consumer), did_observe_user_gesture(false) {}
112 114
113 bool operator<(const ConsumerInfo& other) const { 115 bool operator<(const ConsumerInfo& other) const {
114 return consumer < other.consumer; 116 return consumer < other.consumer;
115 } 117 }
116 118
117 device::GamepadConsumer* consumer; 119 device::GamepadConsumer* consumer;
118 mutable bool is_active; 120 mutable bool is_active;
(...skipping 10 matching lines...) Expand all
129 int num_active_consumers_; 131 int num_active_consumers_;
130 132
131 bool gesture_callback_pending_; 133 bool gesture_callback_pending_;
132 134
133 DISALLOW_COPY_AND_ASSIGN(GamepadService); 135 DISALLOW_COPY_AND_ASSIGN(GamepadService);
134 }; 136 };
135 137
136 } // namespace content 138 } // namespace content
137 139
138 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_ 140 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/gamepad/gamepad_service.cc » ('j') | device/gamepad/gamepad_data_fetcher.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698