summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chromeos/chrome_browser_main_chromeos.cc8
-rw-r--r--chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc6
-rw-r--r--chrome/browser/metrics/chromeos_metrics_provider_unittest.cc69
-rw-r--r--chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc40
-rw-r--r--chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h7
-rw-r--r--chrome/test/DEPS1
-rw-r--r--chrome/test/base/testing_io_thread_state.cc6
-rw-r--r--chrome/test/base/view_event_test_platform_part_chromeos.cc6
8 files changed, 54 insertions, 89 deletions
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
index 91005c4..efe91c5 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -119,7 +119,6 @@
#include "content/public/browser/notification_service.h"
#include "content/public/common/main_function_params.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
-#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "media/audio/sounds/sounds_manager.h"
#include "net/base/network_change_notifier.h"
#include "net/socket/ssl_server_socket.h"
@@ -185,12 +184,6 @@ class DBusServices {
// Initialize DBusThreadManager for the browser. This must be done after
// the main message loop is started, as it uses the message loop.
DBusThreadManager::Initialize();
-
- bluez::BluezDBusManager::Initialize(
- DBusThreadManager::Get()->GetSystemBus(),
- chromeos::DBusThreadManager::Get()->IsUsingStub(
- chromeos::DBusClientBundle::BLUETOOTH));
-
PowerPolicyController::Initialize(
DBusThreadManager::Get()->GetPowerManagerClient());
@@ -257,7 +250,6 @@ class DBusServices {
PowerDataCollector::Shutdown();
PowerPolicyController::Shutdown();
device::BluetoothAdapterFactory::Shutdown();
- bluez::BluezDBusManager::Shutdown();
// NOTE: This must only be called if Initialize() was called.
DBusThreadManager::Shutdown();
diff --git a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc
index fc1c8c8..912bd70 100644
--- a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc
+++ b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc
@@ -26,7 +26,6 @@
#include "chromeos/dbus/fake_easy_unlock_client.h"
#include "components/proximity_auth/cryptauth/proto/cryptauth_api.pb.h"
#include "components/proximity_auth/switches.h"
-#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "extensions/browser/api_test_utils.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/event_router_factory.h"
@@ -128,10 +127,6 @@ class EasyUnlockPrivateApiTest : public extensions::ExtensionApiUnittest {
protected:
void SetUp() override {
chromeos::DBusThreadManager::Initialize();
- bluez::BluezDBusManager::Initialize(
- chromeos::DBusThreadManager::Get()->GetSystemBus(),
- chromeos::DBusThreadManager::Get()->IsUsingStub(
- chromeos::DBusClientBundle::BLUETOOTH));
client_ = chromeos::DBusThreadManager::Get()->GetEasyUnlockClient();
extensions::ExtensionApiUnittest::SetUp();
@@ -140,7 +135,6 @@ class EasyUnlockPrivateApiTest : public extensions::ExtensionApiUnittest {
void TearDown() override {
extensions::ExtensionApiUnittest::TearDown();
- bluez::BluezDBusManager::Shutdown();
chromeos::DBusThreadManager::Shutdown();
}
diff --git a/chrome/browser/metrics/chromeos_metrics_provider_unittest.cc b/chrome/browser/metrics/chromeos_metrics_provider_unittest.cc
index 1eeb373..f47b5d9 100644
--- a/chrome/browser/metrics/chromeos_metrics_provider_unittest.cc
+++ b/chrome/browser/metrics/chromeos_metrics_provider_unittest.cc
@@ -11,44 +11,41 @@
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
#include "chrome/browser/metrics/chromeos_metrics_provider.h"
#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/dbus/fake_bluetooth_adapter_client.h"
+#include "chromeos/dbus/fake_bluetooth_agent_manager_client.h"
+#include "chromeos/dbus/fake_bluetooth_device_client.h"
+#include "chromeos/dbus/fake_bluetooth_gatt_characteristic_client.h"
+#include "chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h"
+#include "chromeos/dbus/fake_bluetooth_gatt_service_client.h"
+#include "chromeos/dbus/fake_bluetooth_input_client.h"
#include "chromeos/dbus/power_manager_client.h"
#include "chromeos/login/login_state.h"
#include "components/metrics/proto/system_profile.pb.h"
#include "components/user_manager/user_manager.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
-#include "device/bluetooth/dbus/bluez_dbus_manager.h"
-#include "device/bluetooth/dbus/fake_bluetooth_adapter_client.h"
-#include "device/bluetooth/dbus/fake_bluetooth_agent_manager_client.h"
-#include "device/bluetooth/dbus/fake_bluetooth_device_client.h"
-#include "device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h"
-#include "device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_client.h"
-#include "device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h"
-#include "device/bluetooth/dbus/fake_bluetooth_input_client.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(USE_X11)
#include "ui/events/devices/x11/device_data_manager_x11.h"
#endif
-using bluez::BluetoothAdapterClient;
-using bluez::BluetoothAgentManagerClient;
-using bluez::BluetoothDeviceClient;
-using bluez::BluetoothGattCharacteristicClient;
-using bluez::BluetoothGattDescriptorClient;
-using bluez::BluetoothGattServiceClient;
-using bluez::BluetoothInputClient;
-using bluez::BluezDBusManager;
-using bluez::BluezDBusManagerSetter;
-using bluez::FakeBluetoothAdapterClient;
-using bluez::FakeBluetoothAgentManagerClient;
-using bluez::FakeBluetoothDeviceClient;
-using bluez::FakeBluetoothGattCharacteristicClient;
-using bluez::FakeBluetoothGattDescriptorClient;
-using bluez::FakeBluetoothGattServiceClient;
-using bluez::FakeBluetoothInputClient;
using chromeos::DBusThreadManager;
using chromeos::DBusThreadManagerSetter;
+using chromeos::BluetoothAdapterClient;
+using chromeos::BluetoothAgentManagerClient;
+using chromeos::BluetoothDeviceClient;
+using chromeos::BluetoothGattCharacteristicClient;
+using chromeos::BluetoothGattDescriptorClient;
+using chromeos::BluetoothGattServiceClient;
+using chromeos::BluetoothInputClient;
+using chromeos::FakeBluetoothAdapterClient;
+using chromeos::FakeBluetoothAgentManagerClient;
+using chromeos::FakeBluetoothDeviceClient;
+using chromeos::FakeBluetoothGattCharacteristicClient;
+using chromeos::FakeBluetoothGattDescriptorClient;
+using chromeos::FakeBluetoothGattServiceClient;
+using chromeos::FakeBluetoothInputClient;
using chromeos::PowerManagerClient;
using chromeos::STUB_DBUS_CLIENT_IMPLEMENTATION;
@@ -63,39 +60,37 @@ class ChromeOSMetricsProviderTest : public testing::Test {
#endif
// Set up the fake Bluetooth environment,
- scoped_ptr<BluezDBusManagerSetter> bluez_dbus_setter =
- BluezDBusManager::GetSetterForTesting();
- bluez_dbus_setter->SetBluetoothAdapterClient(
+ scoped_ptr<DBusThreadManagerSetter> dbus_setter =
+ DBusThreadManager::GetSetterForTesting();
+ dbus_setter->SetBluetoothAdapterClient(
scoped_ptr<BluetoothAdapterClient>(new FakeBluetoothAdapterClient));
- bluez_dbus_setter->SetBluetoothDeviceClient(
+ dbus_setter->SetBluetoothDeviceClient(
scoped_ptr<BluetoothDeviceClient>(new FakeBluetoothDeviceClient));
- bluez_dbus_setter->SetBluetoothGattCharacteristicClient(
+ dbus_setter->SetBluetoothGattCharacteristicClient(
scoped_ptr<BluetoothGattCharacteristicClient>(
new FakeBluetoothGattCharacteristicClient));
- bluez_dbus_setter->SetBluetoothGattDescriptorClient(
+ dbus_setter->SetBluetoothGattDescriptorClient(
scoped_ptr<BluetoothGattDescriptorClient>(
new FakeBluetoothGattDescriptorClient));
- bluez_dbus_setter->SetBluetoothGattServiceClient(
+ dbus_setter->SetBluetoothGattServiceClient(
scoped_ptr<BluetoothGattServiceClient>(
new FakeBluetoothGattServiceClient));
- bluez_dbus_setter->SetBluetoothInputClient(
+ dbus_setter->SetBluetoothInputClient(
scoped_ptr<BluetoothInputClient>(new FakeBluetoothInputClient));
- bluez_dbus_setter->SetBluetoothAgentManagerClient(
+ dbus_setter->SetBluetoothAgentManagerClient(
scoped_ptr<BluetoothAgentManagerClient>(
new FakeBluetoothAgentManagerClient));
// Set up a PowerManagerClient instance for PerfProvider.
- scoped_ptr<DBusThreadManagerSetter> dbus_setter =
- DBusThreadManager::GetSetterForTesting();
dbus_setter->SetPowerManagerClient(
scoped_ptr<PowerManagerClient>(
PowerManagerClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION)));
// Grab pointers to members of the thread manager for easier testing.
fake_bluetooth_adapter_client_ = static_cast<FakeBluetoothAdapterClient*>(
- BluezDBusManager::Get()->GetBluetoothAdapterClient());
+ DBusThreadManager::Get()->GetBluetoothAdapterClient());
fake_bluetooth_device_client_ = static_cast<FakeBluetoothDeviceClient*>(
- BluezDBusManager::Get()->GetBluetoothDeviceClient());
+ DBusThreadManager::Get()->GetBluetoothDeviceClient());
// Initialize the login state trackers.
if (!chromeos::LoginState::IsInitialized())
diff --git a/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc
index 932d7a9..260b2f6 100644
--- a/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc
@@ -10,13 +10,12 @@
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/dbus/fake_bluetooth_adapter_client.h"
+#include "chromeos/dbus/fake_bluetooth_device_client.h"
#include "chromeos/dbus/fake_cras_audio_client.h"
#include "chromeos/dbus/fake_power_manager_client.h"
#include "content/public/browser/web_ui.h"
#include "device/bluetooth/bluetooth_device_chromeos.h"
-#include "device/bluetooth/dbus/bluez_dbus_manager.h"
-#include "device/bluetooth/dbus/fake_bluetooth_adapter_client.h"
-#include "device/bluetooth/dbus/fake_bluetooth_device_client.h"
namespace {
@@ -64,7 +63,7 @@ const char kPairedPropertyName[] = "Paired";
namespace chromeos {
class DeviceEmulatorMessageHandler::BluetoothObserver
- : public bluez::BluetoothDeviceClient::Observer {
+ : public BluetoothDeviceClient::Observer {
public:
explicit BluetoothObserver(DeviceEmulatorMessageHandler* owner)
: owner_(owner) {
@@ -180,8 +179,8 @@ void DeviceEmulatorMessageHandler::PowerObserver::PowerChanged(
DeviceEmulatorMessageHandler::DeviceEmulatorMessageHandler()
: fake_bluetooth_device_client_(
- static_cast<bluez::FakeBluetoothDeviceClient*>(
- bluez::BluezDBusManager::Get()
+ static_cast<chromeos::FakeBluetoothDeviceClient*>(
+ chromeos::DBusThreadManager::Get()
->GetBluetoothDeviceClient())),
fake_cras_audio_client_(static_cast<chromeos::FakeCrasAudioClient*>(
chromeos::DBusThreadManager::Get()
@@ -209,7 +208,7 @@ void DeviceEmulatorMessageHandler::HandleRemoveBluetoothDevice(
std::string path;
CHECK(args->GetString(0, &path));
fake_bluetooth_device_client_->RemoveDevice(
- dbus::ObjectPath(bluez::FakeBluetoothAdapterClient::kAdapterPath),
+ dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(path));
}
@@ -224,7 +223,7 @@ void DeviceEmulatorMessageHandler::HandleRequestBluetoothInfo(
// the main adapter.
std::vector<dbus::ObjectPath> paths =
fake_bluetooth_device_client_->GetDevicesForAdapter(
- dbus::ObjectPath(bluez::FakeBluetoothAdapterClient::kAdapterPath));
+ dbus::ObjectPath(chromeos::FakeBluetoothAdapterClient::kAdapterPath));
base::ListValue devices;
// Get each device's properties.
@@ -238,21 +237,21 @@ void DeviceEmulatorMessageHandler::HandleRequestBluetoothInfo(
base::ListValue pairing_method_options;
pairing_method_options.AppendString(
- bluez::FakeBluetoothDeviceClient::kPairingMethodNone);
+ FakeBluetoothDeviceClient::kPairingMethodNone);
pairing_method_options.AppendString(
- bluez::FakeBluetoothDeviceClient::kPairingMethodPinCode);
+ FakeBluetoothDeviceClient::kPairingMethodPinCode);
pairing_method_options.AppendString(
- bluez::FakeBluetoothDeviceClient::kPairingMethodPassKey);
+ FakeBluetoothDeviceClient::kPairingMethodPassKey);
base::ListValue pairing_action_options;
pairing_action_options.AppendString(
- bluez::FakeBluetoothDeviceClient::kPairingActionDisplay);
+ FakeBluetoothDeviceClient::kPairingActionDisplay);
pairing_action_options.AppendString(
- bluez::FakeBluetoothDeviceClient::kPairingActionRequest);
+ FakeBluetoothDeviceClient::kPairingActionRequest);
pairing_action_options.AppendString(
- bluez::FakeBluetoothDeviceClient::kPairingActionConfirmation);
+ FakeBluetoothDeviceClient::kPairingActionConfirmation);
pairing_action_options.AppendString(
- bluez::FakeBluetoothDeviceClient::kPairingActionFail);
+ FakeBluetoothDeviceClient::kPairingActionFail);
// Send the list of devices to the view.
web_ui()->CallJavascriptFunction(kUpdateBluetoothInfoJSCallback,
@@ -264,7 +263,7 @@ void DeviceEmulatorMessageHandler::HandleRequestBluetoothPair(
const base::ListValue* args) {
// Create the device if it does not already exist.
std::string path = CreateBluetoothDeviceFromListValue(args);
- bluez::FakeBluetoothDeviceClient::Properties* props =
+ chromeos::FakeBluetoothDeviceClient::Properties* props =
fake_bluetooth_device_client_->GetProperties(dbus::ObjectPath(path));
// Try to pair the device with the main adapter. The device is identified
@@ -443,7 +442,7 @@ void DeviceEmulatorMessageHandler::RegisterMessages() {
std::string DeviceEmulatorMessageHandler::CreateBluetoothDeviceFromListValue(
const base::ListValue* args) {
const base::DictionaryValue* device_dict = nullptr;
- bluez::FakeBluetoothDeviceClient::IncomingDeviceProperties props;
+ FakeBluetoothDeviceClient::IncomingDeviceProperties props;
CHECK(args->GetDictionary(0, &device_dict));
CHECK(device_dict->GetString("path", &props.device_path));
@@ -460,7 +459,8 @@ std::string DeviceEmulatorMessageHandler::CreateBluetoothDeviceFromListValue(
// Create the device and store it in the FakeBluetoothDeviceClient's observed
// list of devices.
fake_bluetooth_device_client_->CreateDeviceWithProperties(
- dbus::ObjectPath(bluez::FakeBluetoothAdapterClient::kAdapterPath), props);
+ dbus::ObjectPath(chromeos::FakeBluetoothAdapterClient::kAdapterPath),
+ props);
return props.device_path;
}
@@ -468,11 +468,11 @@ std::string DeviceEmulatorMessageHandler::CreateBluetoothDeviceFromListValue(
scoped_ptr<base::DictionaryValue> DeviceEmulatorMessageHandler::GetDeviceInfo(
const dbus::ObjectPath& object_path) {
// Get the device's properties.
- bluez::FakeBluetoothDeviceClient::Properties* props =
+ chromeos::FakeBluetoothDeviceClient::Properties* props =
fake_bluetooth_device_client_->GetProperties(object_path);
scoped_ptr<base::DictionaryValue> device(new base::DictionaryValue());
scoped_ptr<base::ListValue> uuids(new base::ListValue);
- bluez::FakeBluetoothDeviceClient::SimulatedPairingOptions* options =
+ chromeos::FakeBluetoothDeviceClient::SimulatedPairingOptions* options =
fake_bluetooth_device_client_->GetPairingOptions(object_path);
device->SetString("path", object_path.value());
diff --git a/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h
index 882af77..840111b 100644
--- a/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h
+++ b/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h
@@ -17,12 +17,9 @@ namespace dbus {
class ObjectPath;
} // namespace dbus
-namespace bluez {
-class FakeBluetoothDeviceClient;
-}
-
namespace chromeos {
+class FakeBluetoothDeviceClient;
class FakeCrasAudioClient;
class FakePowerManagerClient;
@@ -102,7 +99,7 @@ class DeviceEmulatorMessageHandler
scoped_ptr<base::DictionaryValue> GetDeviceInfo(
const dbus::ObjectPath& object_path);
- bluez::FakeBluetoothDeviceClient* fake_bluetooth_device_client_;
+ FakeBluetoothDeviceClient* fake_bluetooth_device_client_;
scoped_ptr<BluetoothObserver> bluetooth_observer_;
FakeCrasAudioClient* fake_cras_audio_client_;
diff --git a/chrome/test/DEPS b/chrome/test/DEPS
index 2167a41..2d596c8 100644
--- a/chrome/test/DEPS
+++ b/chrome/test/DEPS
@@ -6,7 +6,6 @@ include_rules = [
"+chrome/grit", # For generated headers
"+chromeos",
"+components",
- "+device/bluetooth/dbus",
"+extensions",
# Tests under chrome/ shouldn't need to access the internals of content/ and
diff --git a/chrome/test/base/testing_io_thread_state.cc b/chrome/test/base/testing_io_thread_state.cc
index 09b07f2..8ebd202 100644
--- a/chrome/test/base/testing_io_thread_state.cc
+++ b/chrome/test/base/testing_io_thread_state.cc
@@ -16,7 +16,6 @@
#if defined(OS_CHROMEOS)
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/network/network_handler.h"
-#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#endif
using content::BrowserThread;
@@ -43,10 +42,6 @@ TestingIOThreadState::TestingIOThreadState() {
#if defined(OS_CHROMEOS)
// Needed by IOThread constructor.
chromeos::DBusThreadManager::Initialize();
- bluez::BluezDBusManager::Initialize(
- chromeos::DBusThreadManager::Get()->GetSystemBus(),
- chromeos::DBusThreadManager::Get()->IsUsingStub(
- chromeos::DBusClientBundle::BLUETOOTH));
chromeos::NetworkHandler::Initialize();
#endif
@@ -80,7 +75,6 @@ TestingIOThreadState::~TestingIOThreadState() {
#if defined(OS_CHROMEOS)
chromeos::NetworkHandler::Shutdown();
- bluez::BluezDBusManager::Shutdown();
chromeos::DBusThreadManager::Shutdown();
#endif
}
diff --git a/chrome/test/base/view_event_test_platform_part_chromeos.cc b/chrome/test/base/view_event_test_platform_part_chromeos.cc
index 16a678e..2cf14ef 100644
--- a/chrome/test/base/view_event_test_platform_part_chromeos.cc
+++ b/chrome/test/base/view_event_test_platform_part_chromeos.cc
@@ -15,7 +15,6 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/network/network_handler.h"
#include "content/public/browser/browser_thread.h"
-#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "ui/aura/env.h"
#include "ui/aura/window_tree_host.h"
#include "ui/message_center/message_center.h"
@@ -47,10 +46,6 @@ ViewEventTestPlatformPartChromeOS::ViewEventTestPlatformPartChromeOS(
// also create the message center.
message_center::MessageCenter::Initialize();
chromeos::DBusThreadManager::Initialize();
- bluez::BluezDBusManager::Initialize(
- chromeos::DBusThreadManager::Get()->GetSystemBus(),
- chromeos::DBusThreadManager::Get()->IsUsingStub(
- chromeos::DBusClientBundle::BLUETOOTH));
chromeos::CrasAudioHandler::InitializeForTesting();
chromeos::NetworkHandler::Initialize();
@@ -75,7 +70,6 @@ ViewEventTestPlatformPartChromeOS::~ViewEventTestPlatformPartChromeOS() {
chromeos::NetworkHandler::Shutdown();
chromeos::CrasAudioHandler::Shutdown();
- bluez::BluezDBusManager::Shutdown();
chromeos::DBusThreadManager::Shutdown();
// Ash Shell can't just live on its own without a browser process, we need to
// also shut down the message center.