summaryrefslogtreecommitdiffstats
path: root/device
Commit message (Collapse)AuthorAgeFilesLines
* Bluetooth: remove legacy backendkeybuk@chromium.org2013-05-2512-5007/+0
| | | | | | | | | BUG=221813 TEST=device_unittests Review URL: https://chromiumcodereview.appspot.com/15020009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202281 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: remove enable-experimental-bluetooth flagkeybuk@chromium.org2013-05-234-30/+3
| | | | | | | | | | BUG=221813 TEST=device_unittests, verify Bluetooth options still available on Chrome OS Review URL: https://chromiumcodereview.appspot.com/15024005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201871 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: Profile support for Chrome OSkeybuk@chromium.org2013-05-0910-6/+1071
| | | | | | | | | | | | Implement support for the BluetoothProfile API for the BlueZ 5.x stack on Chrome OS, including BluetoothSocket support. BUG=229636 TEST=device_unittests Review URL: https://chromiumcodereview.appspot.com/14487002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199095 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: Parse the bluez.Error.Failed on pairing error.deymo@chromium.org2013-05-082-0/+45
| | | | | | | | | | | | | | | The method org.bluez.Device1.Pair can return with different errors. Among those, an org.bluez.Error.Failed: "Device or resource busy" is a possible option. This patch parses that D-Bus error as an ERROR_FAILED. BUG=238479 TEST=BluetoothExperimentalChromeOSTest.PairUnpairableDevice on device_unittests passed with the fix, and fails without it. Review URL: https://chromiumcodereview.appspot.com/15016004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199048 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 198844 "Move sequenced_task_runner to base/task"dbeam@chromium.org2013-05-084-6/+6
| | | | | | | | | | | | | | | | | Reverting revisions that rely on r198820 so to unbreak the build. > Move sequenced_task_runner to base/task > > BUG= > R=akalin@chromium.org > > Review URL: https://codereview.chromium.org/14927008 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/14985007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198848 0039d316-1c4b-4281-b951-d872f2087c98
* Move sequenced_task_runner to base/taskbrettw@chromium.org2013-05-084-6/+6
| | | | | | | | | BUG= R=akalin@chromium.org Review URL: https://codereview.chromium.org/14927008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198844 0039d316-1c4b-4281-b951-d872f2087c98
* Enable Clang warnings in .cc files for Linux+[Aura/ChromeOS]rsleevi@chromium.org2013-05-071-11/+10
| | | | | | | | | BUG=115047 R=darin Review URL: https://chromiumcodereview.appspot.com/14890005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198649 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: set a name for the adapterkeybuk@chromium.org2013-05-063-1/+41
| | | | | | | | | | BUG=220820 TEST=bt_console, show R=youngki@chromium.org Review URL: https://chromiumcodereview.appspot.com/14898004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198544 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented BluetoothDeviceWin::ConnectToProfile()youngki@chromium.org2013-05-057-34/+110
| | | | | | | | | | | | I mostly reused BluetoothServiceRecordWin to implement this method (for now). Even if we deprecate BluetoothServiceRecord, I think we could keep BluetoothServiceRecordWin for Windows platform. After I submit this I will send out cleanup CLs to delete the unused code. BUG=229636 Review URL: https://chromiumcodereview.appspot.com/14582010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198350 0039d316-1c4b-4281-b951-d872f2087c98
* Add a method to check if a D-Bus service has an owner. Use it for mtpd.thestig@chromium.org2013-05-041-24/+47
| | | | | | | | BUG=181064 Review URL: https://chromiumcodereview.appspot.com/14568005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198328 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: make BluetoothProfile constructor protectedkeybuk@chromium.org2013-05-031-4/+1
| | | | | | | | | | BUG=none TEST=device_unittests R=youngki@chromium.org Review URL: https://chromiumcodereview.appspot.com/14884002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198241 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: fix metrics collectionkeybuk@chromium.org2013-05-032-52/+60
| | | | | | | | | | | | | | | | | | | | | | | Bluetooth.PairingMethod was always sent with UMA_PAIRING_METHOD_NONE even when another method was used because the pairing_delegate_used_ flag was never updated. Bluetooth.PairingResult was never called with UMA_PAIRING_RESULT_SUCCESS; add this add the end of OnConnect(), adding a after_pairing flag to the connect chain to ensure we only record this as part of a paring attempt. Bluetooth.PairingResult failures were recorded for ordinary Connect() calls, use the added after_pairing flag to only record them when pairing. BUG=237340 TEST=chrome:///histograms R=youngki@chromium.org Review URL: https://codereview.chromium.org/14889002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198171 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: Check IsPaired() before IsConnected() to avoid false connectionsdeymo@chromium.org2013-05-034-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bluetooth devices can be connected to the adapter for several reasons. One of the reasons is that the user is activelly using the device, so the device is paired/trusted, connected and also connected to a given profile. But that's not the only one, since a Bluetooth device is allowed by the spec to connect to any other device or adapter to do some basic operations like requesting the SDP records. Because of this, IsConnected() can be true in situations where the user didn't inted a connection. If IsPaired() is true, the value of IsConnected() almost implies that the device is connected to the applications (but we can't be sure about that). If IsPaired() is false, the device is neither paired nor trusted, and the value of IsConnected() is mostly irrelevant, since the device is for sure not connected to any application. This fix adds a comments explaining this behavior to the common BluetoothDevice interface and also corrects some ussages of IsConnected() where that value was used even when IsPaired() is false. BUG=237285 TEST=Manual test. Manual test procedure: 1. Go to the settings page: chrome://settings 2. Scan for new devices, select the "Motorola KZ450" Keyboard. 3. Attempt a connect to it. A passkey number should be shown on the screen. 4. Click on "cancel" on that pairing dialog. 5. Immediately after, try to add a new device again. 6. In the "add Bluetooth device" dialog, click on the "Motorola KZ450" keyboard. 7. The "connect" button should be enabled. Click it. 8. The keyboard should ask again for a passkey/pincode to type. Review URL: https://chromiumcodereview.appspot.com/14569023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198083 0039d316-1c4b-4281-b951-d872f2087c98
* Relanding addProfile/removeProfile patch with heapchecker fix.youngki@chromium.org2013-05-016-7/+56
| | | | | | | | | | | | | | | | This is a relanding of r197554 with heapchecker fix. Some profile-dependent services depend on UI thread to clean up, so I had to add UI message loop in bluetooth_event_router_unittest.cc to make sure that all the objects are released at the end of test. I verified with valgrind that this patch does not introduce any new memory leak. BUG=229636 Review URL: https://chromiumcodereview.appspot.com/14569007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197741 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 197554 "Implemented chrome.bluetooth.addProfile and chrom..."timurrrr@chromium.org2013-05-016-56/+7
| | | | | | | | | | | | | | | | | | | This has introduced a few memory leaks on the Valgrind and HeapChecker bots. > Implemented chrome.bluetooth.addProfile and chrome.bluetooth.removeProfile. > > We will reject the registration of the profiles that have already been registered. > When there is an incoming connection, we will route that connection to the extension that registered the profile. > > BUG=229636 > > Review URL: https://chromiumcodereview.appspot.com/14311007 TBR=youngki@chromium.org Review URL: https://codereview.chromium.org/14682006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197580 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented chrome.bluetooth.addProfile and chrome.bluetooth.removeProfile.youngki@chromium.org2013-05-016-7/+56
| | | | | | | | | | | We will reject the registration of the profiles that have already been registered. When there is an incoming connection, we will route that connection to the extension that registered the profile. BUG=229636 Review URL: https://chromiumcodereview.appspot.com/14311007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197554 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: fix fake device classeskeybuk@chromium.org2013-04-301-8/+8
| | | | | | | | | | | | | | | | | | | | | Fake devices are used not only in test cases, but also when running a Chrome OS build of Chromium on Linux. Fix the inverted keyboard/mouse classes so that the "Microsoft Mouse" behaves as the real device and returns false for IsPairable(). This means it can be used to exercise the Connect-without-Pairing case. Add a new "Unconnectable Device" for the test that was testing a device actually failing to connect after being paired. BUG=none TEST=device_unittests, -Dchromeos=1, chrome --enable-experimental-bluetooth, pair with MS Mouse, verify no pairing dialog appears R=satorux@chromium.org, youngki@chromium.org Review URL: https://chromiumcodereview.appspot.com/14273033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197215 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: gather usage metricskeybuk@chromium.org2013-04-2912-7/+248
| | | | | | | | | | | Resubmit; this was reverted in 196993 due to a missing initialization in a unit test. BUG=233820 TEST=chrome:///histograms Review URL: https://codereview.chromium.org/14109028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197148 0039d316-1c4b-4281-b951-d872f2087c98
* device: Use base::MessageLoop.xhwang@chromium.org2013-04-291-26/+28
| | | | | | | | | BUG=236029 R=keybuk@chromium.org Review URL: https://chromiumcodereview.appspot.com/14305031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197112 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: unregister the agent on CancelPairing()keybuk@chromium.org2013-04-291-1/+7
| | | | | | | | | | | | | | | | BluetoothOptionsHandler will call BluetoothDevice::CancelPairing() when it's being torn down, after which pointers to it (e.g. the pairing_delegate_ pointer) are invalid. Thus unregister the agent at this point rather than waiting for a response from the backend. BUG=none TEST=verify no crash when clicking Cancel or Reject during pairing Review URL: https://chromiumcodereview.appspot.com/14273036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197085 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 196990 "Bluetooth: gather usage metrics"thakis@chromium.org2013-04-2812-248/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Broke this test on the CrOs main waterfall bots: MetricsLogTest.RecordEnvironment: [19521:19521:0428/105537:1031147919:FATAL:dbus_thread_manager.cc(562)] Check failed: g_dbus_thread_manager. DBusThreadManager::Get() called before Initialize() [0x7fd74d7ce060] base::debug::StackTrace::StackTrace() [0x7fd74d8085ab] logging::LogMessage::~LogMessage() [0x7fd744a60cfe] chromeos::DBusThreadManager::Get() [0x000003d84f8f] chromeos::BluetoothAdapterChromeOS::BluetoothAdapterChromeOS() [0x000003d82c19] device::BluetoothAdapterFactory::GetAdapter() [0x0000026f1274] MetricsLog::RecordEnvironmentProto() [0x0000026f0bf2] MetricsLog::RecordEnvironment() [0x0000013ad864] MetricsLogTest::TestRecordEnvironment() [0x0000013a95d1] MetricsLogTest_RecordEnvironment_Test::TestBody() [0x000002f37967] testing::internal::HandleSehExceptionsInMethodIfSupported<>() [0x000002f35132] testing::internal::HandleExceptionsInMethodIfSupported<>() [0x000002f2a4e6] testing::Test::Run() [0x000002f2ad0a] testing::TestInfo::Run() [0x000002f2b438] testing::TestCase::Run() [0x000002f303e3] testing::internal::UnitTestImpl::RunAllTests() [0x000002f3876e] testing::internal::HandleSehExceptionsInMethodIfSupported<>() [0x000002f358f7] testing::internal::HandleExceptionsInMethodIfSupported<>() [0x000002f2eeb2] testing::UnitTest::Run() [0x0000045f17ac] base::TestSuite::Run() [0x0000042fe020] content::UnitTestTestSuite::Run() [0x00000306ea62] main [0x7fd73e27b76d] __libc_start_ > Bluetooth: gather usage metrics > > BUG=233820 > TEST=chrome:///histograms > R=isherman@chromium.org, satorux@chromium.org, youngki@chromium.org > > Review URL: https://codereview.chromium.org/13872017 TBR=keybuk@chromium.org Review URL: https://codereview.chromium.org/14001008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196993 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: gather usage metricskeybuk@chromium.org2013-04-2812-7/+248
| | | | | | | | | | BUG=233820 TEST=chrome:///histograms R=isherman@chromium.org, satorux@chromium.org, youngki@chromium.org Review URL: https://codereview.chromium.org/13872017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196990 0039d316-1c4b-4281-b951-d872f2087c98
* fixing the crash: pass the data pointer instead of the class pointer.youngki@chromium.org2013-04-271-2/+2
| | | | | | | | BUG= Review URL: https://chromiumcodereview.appspot.com/14307022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196952 0039d316-1c4b-4281-b951-d872f2087c98
* device: Remove use of ALLOW_THIS_IN_INITIALIZER_LIST.scherkus@chromium.org2013-04-261-1/+1
| | | | | | | | | | It's no longer providing value as the MSVC warning is disabled during compilation. Refer to bug for details. BUG=234765 Review URL: https://codereview.chromium.org/14478006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196805 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented chrome.bluetooth.getProfiles().youngki@chromium.org2013-04-261-0/+1
| | | | | | | | BUG=229636 Review URL: https://chromiumcodereview.appspot.com/14472013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196756 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: send DeviceChanged for more propertieskeybuk@chromium.org2013-04-243-21/+69
| | | | | | | | | | | | | | | | | | | The address and trusted properties of the underlying D-Bus device interface correspond to BluetoothDevice properties, so DeviceChanged() must be sent for a change in value of those too. In addition the reconnect_mode property of the D-Bus input interface changing (including the interface being added and removed for this object) corresponds to BluetoothDevice::IsConnectable() so DeviceChanged() must also be sent. BUG=233370 TEST=device_unittests R=youngki@chromium.org Review URL: https://codereview.chromium.org/14065018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196177 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented BluetoothDeviceMac::ConnectToProfile().youngki@chromium.org2013-04-2417-7/+209
| | | | | | | | | | | | This CL implements BluetoothProfileMac::Connect(), which makes an explicit outgoing connection to the device. I will add unittests once I get a preliminary review from reviewers. BUG=229636 Review URL: https://chromiumcodereview.appspot.com/14405008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196099 0039d316-1c4b-4281-b951-d872f2087c98
* D-Bus: notify properties changed from fakeskeybuk@chromium.org2013-04-241-3/+0
| | | | | | | | | | | | | | | | | Call the property changed callback when fakes use ReplaceValue() or ReplaceValueWithSetValue(), since the actual implementation will always call the callback. This avoids issues with property changed notifications being missing when properties structures are built within fakes. BUG=none TEST=dbus_unittests, device_unittests R=satorux@chromium.org, youngki@chromium.org Review URL: https://codereview.chromium.org/14443003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195977 0039d316-1c4b-4281-b951-d872f2087c98
* Simplified BluetoothAdapterWin.youngki@chromium.org2013-04-246-114/+42
| | | | | | | | | | | | I removed the unnecessary logic of updating |devices_| and calling DeviceChanged() and DeviceRemoved(), which are not used in Windows platform. I also added DevicesUpdated(), which updates |devices_| with paired/connected/remembered devices, and DevicesDiscovered() is used only for "discovered" devices during discovery. BUG=229636 Review URL: https://chromiumcodereview.appspot.com/14273013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195948 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: Cache the pairing passkey and pincode in the option handlerdeymo@chromium.org2013-04-232-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This patch persist the value of pairing, pincode, passkey and entered members of the device object sent to the JS UI while updating the pairing overlay. The passkey and pincode values are persisted only when the pairing value implies their existence. This patch also includes a small bugfix in the DBus agent service provider to properly parse the "entered" argument. BUG=233786 TEST=Manual test. Manual test: ============ Take a 2.1 Bluetooth Keyboard (like the Motorola KZ450) and attempt a pairing with it. While typing the passkey in the keyboard, the keys on the screen should change the style as you type them. Note: Typing the wrong key will also highlight the keys on the screen and that's ok. Review URL: https://chromiumcodereview.appspot.com/14036016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195909 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: fix header sentry comment stylekeybuk@chromium.org2013-04-232-2/+2
| | | | | | | | | | BUG=none TEST=none R=satorux@chromium.org, youngki@chromium.org Review URL: https://codereview.chromium.org/14408002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195814 0039d316-1c4b-4281-b951-d872f2087c98
* Change MediaTransferProtocolManager::Initialize to use a TaskRunner instead ↵thestig@chromium.org2013-04-232-13/+13
| | | | | | | | of a MessageLoopProxy. Review URL: https://chromiumcodereview.appspot.com/13983018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195708 0039d316-1c4b-4281-b951-d872f2087c98
* Add missing BluetoothProfile::Options::auto_connectkeybuk@chromium.org2013-04-222-0/+6
| | | | | | | | | BUG=229636 TEST=none Review URL: https://codereview.chromium.org/14347005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195593 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: Send UI notifications when the connecting status changes.deymo@chromium.org2013-04-203-12/+28
| | | | | | | | | | | | | This fix sends a DeviceChanged notification to all the BluetoothAdapter::Observer when a BluetoothDevice::Connect makes the BluetoothDevice::IsConnecting property change. BUG=231985 TEST=None Review URL: https://chromiumcodereview.appspot.com/12374062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195375 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: D-Bus client interface for org.bluez.Input1deymo@chromium.org2013-04-202-3/+52
| | | | | | | | | | | | Implements the D-Bus client for the new Input1 interface currently exporting only one property. BUG=220553 TEST=device_unittests pass. Review URL: https://chromiumcodereview.appspot.com/14048007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195350 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: call DeviceChanged observer method on IsConnecting() changekeybuk@chromium.org2013-04-204-42/+63
| | | | | | | | | BUG=231985 TEST=device_unittests Review URL: https://codereview.chromium.org/14199010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195345 0039d316-1c4b-4281-b951-d872f2087c98
* Add abstract BluetoothProfile classkeybuk@chromium.org2013-04-1913-1/+192
| | | | | | | | | | | | | This class will form the base of the 4.0 BR+LE compatible API, allowing for both incoming connections for profiles we're clients for and implementing services within Chrome. BUG=229636 TEST=none Review URL: https://chromiumcodereview.appspot.com/13862023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195280 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: Add support for pairing display notificationsdeymo@chromium.org2013-04-193-10/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | The HID 1.1 spec defines a notification signal sent from the device every time the user types a new digit of the provided passkey during the SSP pairing. This patch extends the BluetoothDevice::PairingDelegate interface to support a new method DisplayEnteredKeys to update the number of pressed keys. BUG=221105 TEST=device_unittest and manual test. Manual test part: ================= 1. Open the chrome://settings page in the chromebook and click on "Inspect element". A new panel with the HTML is displayed. 2. Go to the "Console" tab in the opened panel and switch the "<top frame>" drop down in the status line at the bottom of the screen to "settings". 3. Run the following command: options.BrowserOptions.addBluetoothDevice({"name":"MyMouse","address":"00:11:22:33:44:55","pairing":"bluetoothRemotePasskey","entered":4,"passkey":123456}) 4. The passkey 123456 should be displayed on the screen with the first 4 keys in a different style. 5. Replacing "entered":4 by "entered":7 should also change the style of the "enter" key. 6. Removing the "entered":4, should show the keys darker than the "entered":0 state. Review URL: https://chromiumcodereview.appspot.com/13870020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195153 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: treat unpairable devices as Trusted/Pairedkeybuk@chromium.org2013-04-185-33/+106
| | | | | | | | | | | | | | | | | | A small number of devices cannot be paired, but can at least be connected to insecurely. Support these by marking the devices as Trusted, which causes BlueZ to remember the device and which allows future incoming connections from them. Make IsPaired() return true for these devices, there's no reason in the UI to treat these any differently than paired devices. TBR=youngki@chromium.org BUG=232145 TEST=device_unittests Review URL: https://codereview.chromium.org/14225017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195021 0039d316-1c4b-4281-b951-d872f2087c98
* Storage Monitor: Make StorageMonitorLinux own the MediaTransferProtocolManager.thestig@chromium.org2013-04-182-30/+10
| | | | | | Review URL: https://chromiumcodereview.appspot.com/14016002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194994 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: implement BlueZ 5 backend for Chrome OSkeybuk@chromium.org2013-04-186-14/+3048
| | | | | | | | | | | | | | | | Provides an implementation for adapter control, device discovery, pairing, connection, disconnection and unpairing using the BlueZ 5.x backend on Chrome OS. Uses Fake* classes for testing instead of Mocks. TBR=youngki@chromium.org BUG=220951 TEST=device_unittests Review URL: https://chromiumcodereview.appspot.com/13927010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194760 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: Don't attempt a pairing for devices not supporting it.keybuk@chromium.org2013-04-172-0/+19
| | | | | | | | | | | | | | | | | | | Bluetooth mice are not required to be paired, but we attempt to pair to them anyway because some mice, namely the Apple magic mouse, require pairing. Some other mice do NOT support pairing or pretend to support it without doing it properly. This patch adds a small database of bluetooth mice known to not support pairing and tries to connect to them without pairing. BUG=210518 TEST=Attempt to pair with a Verbatim mouse. No pincode should be ask and the mouse should just work. Review URL: https://codereview.chromium.org/13933012 Patch from Alex Deymo <deymo@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194684 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: Show trusted devices as paired.keybuk@chromium.org2013-04-172-1/+4
| | | | | | | | | | | | | | | This short fix in the deprecated bluetooth ChromeOS implementation shows a trusted device (but not paired) as paired. This allows testing the Verbatim mouse in the current implementation. BUG=232145 TEST=Connect to a Verbatim device (connected but not paired). Device shows up in the settings list. Review URL: https://codereview.chromium.org/14316006 Patch from Alex Deymo <deymo@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194621 0039d316-1c4b-4281-b951-d872f2087c98
* Simplified BluetoothDeviceMac.youngki@chromium.org2013-04-123-92/+67
| | | | | | | | | | | | BluetoothDeviceMac holds IOBluetoothDevice, an instance to a single remote Bluetooth device in OSX. BluetoothDeviceMac will use IOBluetoothDevice instance to run all the device-related functions instead of using cached data. Also fixed rfcomm_channel bug in BluetoothSocketMac. BUG=229636 Review URL: https://chromiumcodereview.appspot.com/13983004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194020 0039d316-1c4b-4281-b951-d872f2087c98
* Simplified BluetoothAdapterMac.youngki@chromium.org2013-04-103-238/+24
| | | | | | | | | | | | | | Mainly removed the complicate but unnecessary logic of updating |devices_| with paired devices. Since Bluetooth APIs do not need to listen to any of Device* observer calls for paired devices, I simplified the logic by just repopulating |devices_| when there is a change to those devices. This is the first CL to implement Bluetooth 4.0 APIs and since there might be more changes, I'd rather implement the corresponding test in the later CLs once the shape of this file looks stable. BUG=229636 Review URL: https://chromiumcodereview.appspot.com/13862020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193313 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite std::string("") to std::string(), Linux edition.dcheng@chromium.org2013-04-092-8/+8
| | | | | | | | | | | | | | | | | | | This patch was generated by running the empty_string clang tool across the Chromium Linux compilation database. Implicitly or explicitly constructing std::string() with a "" argument is inefficient as the caller needs to emit extra instructions to pass an argument, and the constructor needlessly copies a byte into internal storage. Rewriting these instances to simply call the default constructor appears to save ~14-18 kilobytes on an optimized release build. BUG=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193020 Review URL: https://codereview.chromium.org/13145003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193040 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Rewrite std::string("") to std::string(), Linux edition."dcheng@chromium.org2013-04-092-8/+8
| | | | | | | | | | | | | | This reverts commit e59558b78e8c6a1b0bd916a724724b638c3c91b6. Revert "Fix build after r193020." This reverts commit 558a35897f6b3ffbcaefde927c1f150b815d140a. Revert "Really fix build after r193020." This reverts commit e3748a79b523a8d365d4a33ef986eebb4186fa78. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193030 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite std::string("") to std::string(), Linux edition.dcheng@chromium.org2013-04-092-8/+8
| | | | | | | | | | | | | | | | | This patch was generated by running the empty_string clang tool across the Chromium Linux compilation database. Implicitly or explicitly constructing std::string() with a "" argument is inefficient as the caller needs to emit extra instructions to pass an argument, and the constructor needlessly copies a byte into internal storage. Rewriting these instances to simply call the default constructor appears to save ~14-18 kilobytes on an optimized release build. BUG=none Review URL: https://codereview.chromium.org/13145003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193020 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: clean up Bluetooth classeskeybuk@chromium.org2013-04-0523-180/+310
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The abstract BluetoothDevice class has a few problems inherited from its origin as a ChromeOS-specific class split between implementation and platform-specific components. Clean those problems up, specifically: - replace bluetooth_class_, name_ and address_ non-abstract members with getter functions that the platform should implement. - also make IsConnected(), IsConnectable() and IsConnecting() abstract functions rather than providing an implementation - remove IsVisible() which was a CrOS-specific hack - remove IsBonded(), use IsPaired() instead - remove service_uuids_ non-abstract member; make GetServices return a copy of the list to allow implementations to fetch it on demand BluetoothDevice retains implementations for GetName(), GetDisplayType() and ProvidesServiceWithUUID() since those can be implemented entirely using platform-provided information functions and would be identical in each platform. Also rename BluetoothAdapter::address() and BluetoothAdapter::name() to GetAddress() and GetName() to match since they are also pure virtual. BUG=none TEST=device_unittests, browser_tests, unit_tests Review URL: https://chromiumcodereview.appspot.com/13416005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192474 0039d316-1c4b-4281-b951-d872f2087c98
* Bluetooth: rename experimental ChromeOS fileskeybuk@chromium.org2013-04-034-30/+30
| | | | | | | | | | | | Only files ending in _chromeos.* are automatically excluded from other builds, so rename the experimental files to match that pattern. BUG=none TEST=make Review URL: https://codereview.chromium.org/13460011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191952 0039d316-1c4b-4281-b951-d872f2087c98