OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.h
" | 5 #include "chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.h
" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 namespace chromeos { | 49 namespace chromeos { |
50 namespace options2 { | 50 namespace options2 { |
51 | 51 |
52 BluetoothOptionsHandler::BluetoothOptionsHandler() : weak_ptr_factory_(this) { | 52 BluetoothOptionsHandler::BluetoothOptionsHandler() : weak_ptr_factory_(this) { |
53 } | 53 } |
54 | 54 |
55 BluetoothOptionsHandler::~BluetoothOptionsHandler() { | 55 BluetoothOptionsHandler::~BluetoothOptionsHandler() { |
56 if (!CommandLine::ForCurrentProcess() | |
57 ->HasSwitch(switches::kEnableBluetooth)) { | |
58 return; | |
59 } | |
60 | |
61 if (adapter_.get()) | 56 if (adapter_.get()) |
62 adapter_->RemoveObserver(this); | 57 adapter_->RemoveObserver(this); |
63 } | 58 } |
64 | 59 |
65 void BluetoothOptionsHandler::GetLocalizedValues( | 60 void BluetoothOptionsHandler::GetLocalizedValues( |
66 DictionaryValue* localized_strings) { | 61 DictionaryValue* localized_strings) { |
67 DCHECK(localized_strings); | 62 DCHECK(localized_strings); |
68 localized_strings->SetString("bluetooth", | 63 localized_strings->SetString("bluetooth", |
69 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH)); | 64 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH)); |
70 localized_strings->SetString("disableBluetooth", | 65 localized_strings->SetString("disableBluetooth", |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 void BluetoothOptionsHandler::ErrorCallback() { | 395 void BluetoothOptionsHandler::ErrorCallback() { |
401 // TODO(keybuk): we don't get any form of error response from dbus:: | 396 // TODO(keybuk): we don't get any form of error response from dbus:: |
402 // yet, other than an error occurred. I'm going to fix that, then this | 397 // yet, other than an error occurred. I'm going to fix that, then this |
403 // gets replaced by genuine error information from the method which we | 398 // gets replaced by genuine error information from the method which we |
404 // can act on, rather than a debug log statement. | 399 // can act on, rather than a debug log statement. |
405 DVLOG(1) << "Failed."; | 400 DVLOG(1) << "Failed."; |
406 } | 401 } |
407 | 402 |
408 } // namespace options2 | 403 } // namespace options2 |
409 } // namespace chromeos | 404 } // namespace chromeos |
OLD | NEW |