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

Unified Diff: device/gamepad/gamepad_platform_data_fetcher_android.cc

Issue 2081583002: Migrating majority of gamepad from content/browser/ to device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final tweaks 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 side-by-side diff with in-line comments
Download patch
Index: device/gamepad/gamepad_platform_data_fetcher_android.cc
diff --git a/content/browser/gamepad/gamepad_platform_data_fetcher_android.cc b/device/gamepad/gamepad_platform_data_fetcher_android.cc
similarity index 93%
rename from content/browser/gamepad/gamepad_platform_data_fetcher_android.cc
rename to device/gamepad/gamepad_platform_data_fetcher_android.cc
index 1e38cc7f5a97a8937e692651ea45dfc1a27d8209..9a14515f608e5275e1574dbde315b25a8e1faa05 100644
--- a/content/browser/gamepad/gamepad_platform_data_fetcher_android.cc
+++ b/device/gamepad/gamepad_platform_data_fetcher_android.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/gamepad/gamepad_platform_data_fetcher_android.h"
+#include "device/gamepad/gamepad_platform_data_fetcher_android.h"
#include <stddef.h>
@@ -26,11 +26,10 @@ using base::android::ScopedJavaLocalRef;
using blink::WebGamepad;
using blink::WebGamepads;
-namespace content {
+namespace device {
-bool
-GamepadPlatformDataFetcherAndroid::RegisterGamepadPlatformDataFetcherAndroid(
- JNIEnv* env) {
+bool GamepadPlatformDataFetcherAndroid::
+ RegisterGamepadPlatformDataFetcherAndroid(JNIEnv* env) {
return RegisterNativesImpl(env);
}
@@ -103,16 +102,14 @@ static void SetGamepadData(JNIEnv* env,
base::android::ConvertJavaStringToUTF16(env, devicename, &device_name);
const size_t name_to_copy =
std::min(device_name.size(), WebGamepad::idLengthCap - 1);
- memcpy(pad.id,
- device_name.data(),
+ memcpy(pad.id, device_name.data(),
name_to_copy * sizeof(base::string16::value_type));
pad.id[name_to_copy] = 0;
base::string16 mapping_name = base::UTF8ToUTF16(mapping ? "standard" : "");
const size_t mapping_to_copy =
std::min(mapping_name.size(), WebGamepad::mappingLengthCap - 1);
- memcpy(pad.mapping,
- mapping_name.data(),
+ memcpy(pad.mapping, mapping_name.data(),
mapping_to_copy * sizeof(base::string16::value_type));
pad.mapping[mapping_to_copy] = 0;
@@ -148,4 +145,4 @@ static void SetGamepadData(JNIEnv* env,
}
}
-} // namespace content
+} // namespace device
« no previous file with comments | « device/gamepad/gamepad_platform_data_fetcher_android.h ('k') | device/gamepad/gamepad_platform_data_fetcher_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698