diff options
author | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-14 20:22:53 +0000 |
---|---|---|
committer | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-14 20:22:53 +0000 |
commit | 02743b707e2743cd0f0916e3b405191a48fa3947 (patch) | |
tree | 2b0c0be422f99a2e0dce81c6de92f9a8bc80b969 /chrome/browser/chromeos/bluetooth/bluetooth_manager.cc | |
parent | 7f58f3f417a0598ad796ca7de7b14a38252d91bd (diff) | |
download | chromium_src-02743b707e2743cd0f0916e3b405191a48fa3947.zip chromium_src-02743b707e2743cd0f0916e3b405191a48fa3947.tar.gz chromium_src-02743b707e2743cd0f0916e3b405191a48fa3947.tar.bz2 |
Revert 121920 - dbus: add ObjectPath type
Rather than use std::string for object paths, add a dbus::ObjectPath type
that wraps one while allowing more type-safety. This solves all sorts of
issues with confusing object paths for strings, and allows us to do
Properties code using templates disambiguating them from strings.
BUG=chromium:109194
TEST=built and run tests
Change-Id: Icaf6f19daea4af23a9d2ec0ed76d2cbd379d680e
Review URL: http://codereview.chromium.org/9378039
TBR=keybuk@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9363045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121923 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/bluetooth/bluetooth_manager.cc')
-rw-r--r-- | chrome/browser/chromeos/bluetooth/bluetooth_manager.cc | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_manager.cc b/chrome/browser/chromeos/bluetooth/bluetooth_manager.cc index ef362f0..3161885 100644 --- a/chrome/browser/chromeos/bluetooth/bluetooth_manager.cc +++ b/chrome/browser/chromeos/bluetooth/bluetooth_manager.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,7 +10,6 @@ #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" #include "chrome/browser/chromeos/dbus/bluetooth_manager_client.h" #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" -#include "dbus/object_path.h" namespace chromeos { @@ -51,10 +50,9 @@ class BluetoothManagerImpl : public BluetoothManager, } // BluetoothManagerClient::Observer override. - virtual void AdapterRemoved(const dbus::ObjectPath& adapter) { - VLOG(1) << "AdapterRemoved: " << adapter.value(); - if (default_adapter_.get() == NULL - || default_adapter_->Id() != adapter.value()) { + virtual void AdapterRemoved(const std::string& adapter) { + VLOG(1) << "AdapterRemoved: " << adapter; + if (default_adapter_.get() == NULL || default_adapter_->Id() != adapter) { return; } // The default adapter was removed. @@ -64,8 +62,8 @@ class BluetoothManagerImpl : public BluetoothManager, } // BluetoothManagerClient::Observer override. - virtual void DefaultAdapterChanged(const dbus::ObjectPath& adapter) { - VLOG(1) << "DefaultAdapterChanged: " << adapter.value(); + virtual void DefaultAdapterChanged(const std::string& adapter) { + VLOG(1) << "DefaultAdapterChanged: " << adapter; OnNewDefaultAdapter(adapter); } @@ -75,13 +73,12 @@ class BluetoothManagerImpl : public BluetoothManager, } // We have updated info about the default adapter. - void OnNewDefaultAdapter(const dbus::ObjectPath& adapter) { - VLOG(1) << "OnNewDefaultAdapter: " << adapter.value(); - if (default_adapter_.get() != NULL - && default_adapter_->Id() == adapter.value()) { + void OnNewDefaultAdapter(const std::string& adapter) { + VLOG(1) << "OnNewDefaultAdapter: " << adapter; + if (default_adapter_.get() != NULL && default_adapter_->Id() == adapter) { return; } - default_adapter_.reset(BluetoothAdapter::Create(adapter.value())); + default_adapter_.reset(BluetoothAdapter::Create(adapter)); DCHECK(default_adapter_.get()); FOR_EACH_OBSERVER(BluetoothManager::Observer, observers_, DefaultAdapterChanged(default_adapter_.get())); @@ -89,12 +86,12 @@ class BluetoothManagerImpl : public BluetoothManager, // Called by bluetooth_manager_client when our DefaultAdapter request is // complete - void OnDefaultAdapter(const dbus::ObjectPath& adapter, bool success) { + void OnDefaultAdapter(const std::string& adapter, bool success) { if (!success) { LOG(ERROR) << "OnDefaultAdapter: failed."; return; } - VLOG(1) << "OnDefaultAdapter: " << adapter.value(); + VLOG(1) << "OnDefaultAdapter: " << adapter; OnNewDefaultAdapter(adapter); } |