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

Side by Side Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 13933012: Bluetooth: Don't attempt a pairing for devices not supporting it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: todo added Created 7 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chromeos/system/ash_system_tray_delegate.h" 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 } 607 }
608 608
609 virtual void ToggleBluetoothConnection(const std::string& address) OVERRIDE { 609 virtual void ToggleBluetoothConnection(const std::string& address) OVERRIDE {
610 device::BluetoothDevice* device = bluetooth_adapter_->GetDevice(address); 610 device::BluetoothDevice* device = bluetooth_adapter_->GetDevice(address);
611 if (!device || device->IsConnecting()) 611 if (!device || device->IsConnecting())
612 return; 612 return;
613 if (device->IsConnected()) { 613 if (device->IsConnected()) {
614 device->Disconnect( 614 device->Disconnect(
615 base::Bind(&base::DoNothing), 615 base::Bind(&base::DoNothing),
616 base::Bind(&BluetoothDeviceDisconnectError)); 616 base::Bind(&BluetoothDeviceDisconnectError));
617 } else if (device->IsPaired()) { 617 } else if (device->IsPaired() || !device->IsPairable()) {
618 device->Connect( 618 device->Connect(
619 NULL, 619 NULL,
620 base::Bind(&base::DoNothing), 620 base::Bind(&base::DoNothing),
621 base::Bind(&BluetoothDeviceConnectError)); 621 base::Bind(&BluetoothDeviceConnectError));
622 } else { // Show paring dialog for the unpaired device. 622 } else { // Show paring dialog for the unpaired device.
623 BluetoothPairingDialog* dialog = 623 BluetoothPairingDialog* dialog =
624 new BluetoothPairingDialog(GetNativeWindow(), device); 624 new BluetoothPairingDialog(GetNativeWindow(), device);
625 // The dialog deletes itself on close. 625 // The dialog deletes itself on close.
626 dialog->Show(); 626 dialog->Show();
627 } 627 }
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); 1583 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate);
1584 }; 1584 };
1585 1585
1586 } // namespace 1586 } // namespace
1587 1587
1588 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1588 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1589 return new chromeos::SystemTrayDelegate(); 1589 return new chromeos::SystemTrayDelegate();
1590 } 1590 }
1591 1591
1592 } // namespace chromeos 1592 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698