diff options
author | keybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-01 23:57:46 +0000 |
---|---|---|
committer | keybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-01 23:57:46 +0000 |
commit | 28588ac648c6eae2f5fa485ae4d64651ee1a3399 (patch) | |
tree | b14ea48ac3d736f001816474e62b084a7d81244b /chrome | |
parent | ee902534b0eda754b4ba9389fe479864b9373c7f (diff) | |
download | chromium_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')
-rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
-rw-r--r-- | chrome/browser/chromeos/bluetooth/bluetooth_device.cc | 22 | ||||
-rw-r--r-- | chrome/browser/chromeos/bluetooth/bluetooth_device.h | 2 |
3 files changed, 28 insertions, 2 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index eff5f36..722ab61 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -16008,6 +16008,12 @@ Battery full <message name="IDS_BLUETOOTH_DEVICE_MODEM" desc="Text to identify bluetooth devices of the modem class."> Modem (<ph name="ADDRESS">$1<ex>12:34:56:78:9A:BC</ex></ph>) </message> + <message name="IDS_BLUETOOTH_DEVICE_JOYSTICK" desc="Text to identify bluetooth devices of the joystick class."> + Joystick (<ph name="ADDRESS">$1<ex>12:34:56:78:9A:BC</ex></ph>) + </message> + <message name="IDS_BLUETOOTH_DEVICE_GAMEPAD" desc="Text to identify bluetooth devices of the gamepad class."> + Gamepad (<ph name="ADDRESS">$1<ex>12:34:56:78:9A:BC</ex></ph>) + </message> <message name="IDS_BLUETOOTH_DEVICE_KEYBOARD" desc="Text to identify bluetooth devices of the keyboard class."> Keyboard (<ph name="ADDRESS">$1<ex>12:34:56:78:9A:BC</ex></ph>) </message> 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, |