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

Side by Side Diff: content/shell/renderer/test_runner/gamepad_controller.cc

Issue 264003003: test_runner: Move everything else into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shell/renderer/test_runner/gamepad_controller.h" 5 #include "content/shell/renderer/test_runner/gamepad_controller.h"
6 6
7 #include "content/shell/renderer/test_runner/TestInterfaces.h" 7 #include "content/shell/renderer/test_runner/TestInterfaces.h"
8 #include "content/shell/renderer/test_runner/WebTestDelegate.h" 8 #include "content/shell/renderer/test_runner/WebTestDelegate.h"
9 #include "gin/arguments.h" 9 #include "gin/arguments.h"
10 #include "gin/handle.h" 10 #include "gin/handle.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 GamepadController::~GamepadController() {} 143 GamepadController::~GamepadController() {}
144 144
145 void GamepadController::Reset() { 145 void GamepadController::Reset() {
146 memset(&gamepads_, 0, sizeof(gamepads_)); 146 memset(&gamepads_, 0, sizeof(gamepads_));
147 } 147 }
148 148
149 void GamepadController::Install(WebFrame* frame) { 149 void GamepadController::Install(WebFrame* frame) {
150 GamepadControllerBindings::Install(weak_factory_.GetWeakPtr(), frame); 150 GamepadControllerBindings::Install(weak_factory_.GetWeakPtr(), frame);
151 } 151 }
152 152
153 void GamepadController::SetDelegate(WebTestRunner::WebTestDelegate* delegate) { 153 void GamepadController::SetDelegate(WebTestDelegate* delegate) {
154 delegate_ = delegate; 154 delegate_ = delegate;
155 } 155 }
156 156
157 void GamepadController::Connect(int index) { 157 void GamepadController::Connect(int index) {
158 if (index < 0 || index >= static_cast<int>(WebGamepads::itemsLengthCap)) 158 if (index < 0 || index >= static_cast<int>(WebGamepads::itemsLengthCap))
159 return; 159 return;
160 gamepads_.items[index].connected = true; 160 gamepads_.items[index].connected = true;
161 gamepads_.length = 0; 161 gamepads_.length = 0;
162 for (unsigned i = 0; i < WebGamepads::itemsLengthCap; ++i) { 162 for (unsigned i = 0; i < WebGamepads::itemsLengthCap; ++i) {
163 if (gamepads_.items[i].connected) 163 if (gamepads_.items[i].connected)
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 if (index < 0 || index >= static_cast<int>(WebGamepads::itemsLengthCap)) 237 if (index < 0 || index >= static_cast<int>(WebGamepads::itemsLengthCap))
238 return; 238 return;
239 if (axis < 0 || axis >= static_cast<int>(WebGamepad::axesLengthCap)) 239 if (axis < 0 || axis >= static_cast<int>(WebGamepad::axesLengthCap))
240 return; 240 return;
241 gamepads_.items[index].axes[axis] = data; 241 gamepads_.items[index].axes[axis] = data;
242 if (delegate_) 242 if (delegate_)
243 delegate_->setGamepadData(gamepads_); 243 delegate_->setGamepadData(gamepads_);
244 } 244 }
245 245
246 } // namespace content 246 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/gamepad_controller.h ('k') | content/shell/renderer/test_runner/notification_presenter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698