Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3498)

Unified Diff: chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc

Issue 10899037: Refactoring bluetooth API code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing styles and tess. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc
index b6ca46a5dfc1176241089a593432238cf689df18..7f87bcb2aa9800669e611c333c02dd4fcf072ad4 100644
--- a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc
@@ -12,7 +12,8 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h"
-#include "chrome/browser/chromeos/bluetooth/bluetooth_device.h"
+#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter_dbus.h"
+#include "chrome/browser/chromeos/bluetooth/bluetooth_device_dbus.h"
#include "content/public/browser/web_ui.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -123,8 +124,8 @@ void BluetoothOptionsHandler::GetLocalizedValues(
// TODO(kevers): Reorder methods to match ordering in the header file.
-void BluetoothOptionsHandler::AdapterPresentChanged(BluetoothAdapter* adapter,
- bool present) {
+void BluetoothOptionsHandler::AdapterPresentChanged(
+ BluetoothAdapter* adapter, bool present) {
DCHECK(adapter == adapter_.get());
if (present) {
web_ui()->CallJavascriptFunction(
@@ -139,14 +140,18 @@ void BluetoothOptionsHandler::AdapterPresentChanged(BluetoothAdapter* adapter,
}
}
-void BluetoothOptionsHandler::AdapterPoweredChanged(BluetoothAdapter* adapter,
- bool powered) {
+void BluetoothOptionsHandler::AdapterPoweredChanged(
+ BluetoothAdapter* adapter, bool powered) {
DCHECK(adapter == adapter_.get());
base::FundamentalValue checked(powered);
web_ui()->CallJavascriptFunction(
"options.BrowserOptions.setBluetoothState", checked);
}
+void BluetoothOptionsHandler::AdapterDiscoveringChanged(
+ BluetoothAdapter* adapter, bool discovering) {
+}
+
keybuk 2012/09/13 23:57:30 Why has this empty method been added?
youngki 2012/09/17 21:53:02 Removed.
void BluetoothOptionsHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("bluetoothEnableChange",
base::Bind(&BluetoothOptionsHandler::EnableChangeCallback,
@@ -166,7 +171,7 @@ void BluetoothOptionsHandler::RegisterMessages() {
}
void BluetoothOptionsHandler::InitializeHandler() {
- adapter_ = BluetoothAdapter::DefaultAdapter();
+ adapter_ = BluetoothAdapterDBus::DefaultAdapter();
adapter_->AddObserver(this);
}
@@ -215,7 +220,8 @@ void BluetoothOptionsHandler::UpdateDeviceCallback(
std::string address;
args->GetString(kUpdateDeviceAddressIndex, &address);
- BluetoothDevice* device = adapter_->GetDevice(address);
+ BluetoothDeviceDBus* device = static_cast<BluetoothDeviceDBus *>(
+ adapter_->GetDevice(address));
keybuk 2012/09/13 23:57:30 Why does this need a static_cast? This interface n
youngki 2012/09/17 21:53:02 Done.
if (!device)
return;
@@ -331,8 +337,7 @@ void BluetoothOptionsHandler::GetPairedDevicesCallback(
}
void BluetoothOptionsHandler::SendDeviceNotification(
- const BluetoothDevice* device,
- base::DictionaryValue* params) {
+ const BluetoothDevice* device, base::DictionaryValue* params) {
base::DictionaryValue js_properties;
js_properties.SetString("name", device->GetName());
js_properties.SetString("address", device->address());

Powered by Google App Engine
This is Rietveld 408576698