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

Side by Side Diff: components/test_runner/gamepad_controller.cc

Issue 1167703002: Move test runner to a component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 6 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 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 "components/test_runner/gamepad_controller.h"
6 6
7 #include "content/shell/renderer/test_runner/web_test_delegate.h" 7 #include "components/test_runner/web_test_delegate.h"
8 #include "gin/arguments.h" 8 #include "gin/arguments.h"
9 #include "gin/handle.h" 9 #include "gin/handle.h"
10 #include "gin/object_template_builder.h" 10 #include "gin/object_template_builder.h"
11 #include "gin/wrappable.h" 11 #include "gin/wrappable.h"
12 #include "third_party/WebKit/public/platform/WebGamepadListener.h" 12 #include "third_party/WebKit/public/platform/WebGamepadListener.h"
13 #include "third_party/WebKit/public/web/WebFrame.h" 13 #include "third_party/WebKit/public/web/WebFrame.h"
14 #include "third_party/WebKit/public/web/WebKit.h" 14 #include "third_party/WebKit/public/web/WebKit.h"
15 #include "v8/include/v8.h" 15 #include "v8/include/v8.h"
16 16
17 using blink::WebFrame; 17 using blink::WebFrame;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 base::WeakPtr<GamepadController> controller) 78 base::WeakPtr<GamepadController> controller)
79 : controller_(controller) {} 79 : controller_(controller) {}
80 80
81 GamepadControllerBindings::~GamepadControllerBindings() {} 81 GamepadControllerBindings::~GamepadControllerBindings() {}
82 82
83 gin::ObjectTemplateBuilder GamepadControllerBindings::GetObjectTemplateBuilder( 83 gin::ObjectTemplateBuilder GamepadControllerBindings::GetObjectTemplateBuilder(
84 v8::Isolate* isolate) { 84 v8::Isolate* isolate) {
85 return gin::Wrappable<GamepadControllerBindings>::GetObjectTemplateBuilder( 85 return gin::Wrappable<GamepadControllerBindings>::GetObjectTemplateBuilder(
86 isolate) 86 isolate)
87 .SetMethod("connect", &GamepadControllerBindings::Connect) 87 .SetMethod("connect", &GamepadControllerBindings::Connect)
88 .SetMethod("dispatchConnected", &GamepadControllerBindings::DispatchConnec ted) 88 .SetMethod("dispatchConnected",
89 &GamepadControllerBindings::DispatchConnected)
89 .SetMethod("disconnect", &GamepadControllerBindings::Disconnect) 90 .SetMethod("disconnect", &GamepadControllerBindings::Disconnect)
90 .SetMethod("setId", &GamepadControllerBindings::SetId) 91 .SetMethod("setId", &GamepadControllerBindings::SetId)
91 .SetMethod("setButtonCount", &GamepadControllerBindings::SetButtonCount) 92 .SetMethod("setButtonCount", &GamepadControllerBindings::SetButtonCount)
92 .SetMethod("setButtonData", &GamepadControllerBindings::SetButtonData) 93 .SetMethod("setButtonData", &GamepadControllerBindings::SetButtonData)
93 .SetMethod("setAxisCount", &GamepadControllerBindings::SetAxisCount) 94 .SetMethod("setAxisCount", &GamepadControllerBindings::SetAxisCount)
94 .SetMethod("setAxisData", &GamepadControllerBindings::SetAxisData); 95 .SetMethod("setAxisData", &GamepadControllerBindings::SetAxisData);
95 } 96 }
96 97
97 void GamepadControllerBindings::Connect(int index) { 98 void GamepadControllerBindings::Connect(int index) {
98 if (controller_) 99 if (controller_)
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 241
241 void GamepadController::SetAxisData(int index, int axis, double data) { 242 void GamepadController::SetAxisData(int index, int axis, double data) {
242 if (index < 0 || index >= static_cast<int>(WebGamepads::itemsLengthCap)) 243 if (index < 0 || index >= static_cast<int>(WebGamepads::itemsLengthCap))
243 return; 244 return;
244 if (axis < 0 || axis >= static_cast<int>(WebGamepad::axesLengthCap)) 245 if (axis < 0 || axis >= static_cast<int>(WebGamepad::axesLengthCap))
245 return; 246 return;
246 gamepads_.items[index].axes[axis] = data; 247 gamepads_.items[index].axes[axis] = data;
247 } 248 }
248 249
249 } // namespace content 250 } // namespace content
OLDNEW
« no previous file with comments | « components/test_runner/gamepad_controller.h ('k') | components/test_runner/helper/layout_test_helper_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698