Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" | 5 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 VLOG(1) << "StopDiscovery: " << object_path.value() << ", " | 171 VLOG(1) << "StopDiscovery: " << object_path.value() << ", " |
| 172 << "count is now " << discovering_count_; | 172 << "count is now " << discovering_count_; |
| 173 PostDelayedTask(callback); | 173 PostDelayedTask(callback); |
| 174 | 174 |
| 175 if (discovering_count_ == 0) { | 175 if (discovering_count_ == 0) { |
| 176 FakeBluetoothDeviceClient* device_client = | 176 FakeBluetoothDeviceClient* device_client = |
| 177 static_cast<FakeBluetoothDeviceClient*>( | 177 static_cast<FakeBluetoothDeviceClient*>( |
| 178 DBusThreadManager::Get()->GetBluetoothDeviceClient()); | 178 DBusThreadManager::Get()->GetBluetoothDeviceClient()); |
| 179 device_client->EndDiscoverySimulation(dbus::ObjectPath(kAdapterPath)); | 179 device_client->EndDiscoverySimulation(dbus::ObjectPath(kAdapterPath)); |
| 180 | 180 |
| 181 if (simulation_interval_ms_ > 100) { | |
| 182 device_client->BeginIncomingPairingSimulation( | |
| 183 dbus::ObjectPath(kAdapterPath)); | |
|
armansito
2014/02/28 23:20:06
Should we start the simulation only if |properties
keybuk
2014/02/28 23:21:28
Since there's no way to set those in the UI right
armansito
2014/02/28 23:46:03
We seem to be setting pairable to true by default
| |
| 184 } | |
| 185 | |
| 181 properties_->discovering.ReplaceValue(false); | 186 properties_->discovering.ReplaceValue(false); |
| 182 } | 187 } |
| 183 } | 188 } |
| 184 | 189 |
| 185 void FakeBluetoothAdapterClient::RemoveDevice( | 190 void FakeBluetoothAdapterClient::RemoveDevice( |
| 186 const dbus::ObjectPath& object_path, | 191 const dbus::ObjectPath& object_path, |
| 187 const dbus::ObjectPath& device_path, | 192 const dbus::ObjectPath& device_path, |
| 188 const base::Closure& callback, | 193 const base::Closure& callback, |
| 189 const ErrorCallback& error_callback) { | 194 const ErrorCallback& error_callback) { |
| 190 if (object_path != dbus::ObjectPath(kAdapterPath)) { | 195 if (object_path != dbus::ObjectPath(kAdapterPath)) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 } | 265 } |
| 261 | 266 |
| 262 void FakeBluetoothAdapterClient::PostDelayedTask( | 267 void FakeBluetoothAdapterClient::PostDelayedTask( |
| 263 const base::Closure& callback) { | 268 const base::Closure& callback) { |
| 264 base::MessageLoop::current()->PostDelayedTask( | 269 base::MessageLoop::current()->PostDelayedTask( |
| 265 FROM_HERE, callback, | 270 FROM_HERE, callback, |
| 266 base::TimeDelta::FromMilliseconds(simulation_interval_ms_)); | 271 base::TimeDelta::FromMilliseconds(simulation_interval_ms_)); |
| 267 } | 272 } |
| 268 | 273 |
| 269 } // namespace chromeos | 274 } // namespace chromeos |
| OLD | NEW |