summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/bluetooth
diff options
context:
space:
mode:
authorkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-01 23:57:46 +0000
committerkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-01 23:57:46 +0000
commit28588ac648c6eae2f5fa485ae4d64651ee1a3399 (patch)
treeb14ea48ac3d736f001816474e62b084a7d81244b /chrome/browser/chromeos/bluetooth
parentee902534b0eda754b4ba9389fe479864b9373c7f (diff)
downloadchromium_src-28588ac648c6eae2f5fa485ae4d64651ee1a3399.zip
chromium_src-28588ac648c6eae2f5fa485ae4d64651ee1a3399.tar.gz
chromium_src-28588ac648c6eae2f5fa485ae4d64651ee1a3399.tar.bz2
bluetooth: enable gaming devices
BUG=chromium-os:30273 TEST=verified devices show up when discovering Change-Id: I46284ee28675e726d8479bf3e0cbb812bd764b49 Review URL: http://codereview.chromium.org/10279003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134826 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/bluetooth')
-rw-r--r--chrome/browser/chromeos/bluetooth/bluetooth_device.cc22
-rw-r--r--chrome/browser/chromeos/bluetooth/bluetooth_device.h2
2 files changed, 22 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_device.cc b/chrome/browser/chromeos/bluetooth/bluetooth_device.cc
index 2e67c63..051127c 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);
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_device.h b/chrome/browser/chromeos/bluetooth/bluetooth_device.h
index 8e16a0a..f330bb5 100644
--- a/chrome/browser/chromeos/bluetooth/bluetooth_device.h
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_device.h
@@ -47,6 +47,8 @@ class BluetoothDevice : private BluetoothDeviceClient::Observer,
DEVICE_PHONE,
DEVICE_MODEM,
DEVICE_PERIPHERAL,
+ DEVICE_JOYSTICK,
+ DEVICE_GAMEPAD,
DEVICE_KEYBOARD,
DEVICE_MOUSE,
DEVICE_TABLET,