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

Unified Diff: chrome/browser/chromeos/bluetooth/bluetooth_device.cc

Issue 10279003: bluetooth: enable gaming devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « chrome/browser/chromeos/bluetooth/bluetooth_device.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/bluetooth/bluetooth_device.cc
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_device.cc b/chrome/browser/chromeos/bluetooth/bluetooth_device.cc
index 2e67c63d1b6f6e62cd04faa08def5df99bd998d2..051127c798ec5d6fa672a38302587be47c957834 100644
--- a/chrome/browser/chromeos/bluetooth/bluetooth_device.cc
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_device.cc
@@ -110,7 +110,17 @@ BluetoothDevice::DeviceType BluetoothDevice::GetDeviceType() const {
switch ((bluetooth_class_ & 0xc0) >> 6) {
case 0x00:
// "Not a keyboard or pointing device."
- return DEVICE_PERIPHERAL;
+ switch ((bluetooth_class_ & 0x01e) >> 2) {
+ case 0x01:
+ // Joystick.
+ return DEVICE_JOYSTICK;
+ case 0x02:
+ // Gamepad.
+ return DEVICE_GAMEPAD;
+ default:
+ return DEVICE_PERIPHERAL;
+ }
+ break;
case 0x01:
// Keyboard.
return DEVICE_KEYBOARD;
@@ -137,7 +147,9 @@ BluetoothDevice::DeviceType BluetoothDevice::GetDeviceType() const {
bool BluetoothDevice::IsSupported() const {
DeviceType device_type = GetDeviceType();
- return (device_type == DEVICE_KEYBOARD ||
+ return (device_type == DEVICE_JOYSTICK ||
+ device_type == DEVICE_GAMEPAD ||
+ device_type == DEVICE_KEYBOARD ||
device_type == DEVICE_MOUSE ||
device_type == DEVICE_TABLET ||
device_type == DEVICE_KEYBOARD_MOUSE_COMBO);
@@ -156,6 +168,12 @@ string16 BluetoothDevice::GetAddressWithLocalizedDeviceTypeName() const {
case DEVICE_MODEM:
return l10n_util::GetStringFUTF16(IDS_BLUETOOTH_DEVICE_MODEM,
address);
+ case DEVICE_JOYSTICK:
+ return l10n_util::GetStringFUTF16(IDS_BLUETOOTH_DEVICE_JOYSTICK,
+ address);
+ case DEVICE_GAMEPAD:
+ return l10n_util::GetStringFUTF16(IDS_BLUETOOTH_DEVICE_GAMEPAD,
+ address);
case DEVICE_KEYBOARD:
return l10n_util::GetStringFUTF16(IDS_BLUETOOTH_DEVICE_KEYBOARD,
address);
« no previous file with comments | « chrome/browser/chromeos/bluetooth/bluetooth_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698