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

Side by Side Diff: components/pairing/bluetooth_host_pairing_controller.cc

Issue 2808353004: bluetooth: Rename Is*Available to Is*Supported (Closed)
Patch Set: Add const Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/pairing/bluetooth_host_pairing_controller.h" 5 #include "components/pairing/bluetooth_host_pairing_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/hash.h" 8 #include "base/hash.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 void BluetoothHostPairingController::RemoveObserver(Observer* observer) { 464 void BluetoothHostPairingController::RemoveObserver(Observer* observer) {
465 observers_.RemoveObserver(observer); 465 observers_.RemoveObserver(observer);
466 } 466 }
467 467
468 HostPairingController::Stage BluetoothHostPairingController::GetCurrentStage() { 468 HostPairingController::Stage BluetoothHostPairingController::GetCurrentStage() {
469 return current_stage_; 469 return current_stage_;
470 } 470 }
471 471
472 void BluetoothHostPairingController::StartPairing() { 472 void BluetoothHostPairingController::StartPairing() {
473 DCHECK_EQ(current_stage_, STAGE_NONE); 473 DCHECK_EQ(current_stage_, STAGE_NONE);
474 bool bluetooth_available = 474 const bool bluetooth_supported =
475 device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable(); 475 device::BluetoothAdapterFactory::IsBluetoothSupported();
476 if (!bluetooth_available) { 476 if (!bluetooth_supported) {
477 ChangeStage(STAGE_INITIALIZATION_ERROR); 477 ChangeStage(STAGE_INITIALIZATION_ERROR);
478 return; 478 return;
479 } 479 }
480 480
481 device::BluetoothAdapterFactory::GetAdapter( 481 device::BluetoothAdapterFactory::GetAdapter(
482 base::Bind(&BluetoothHostPairingController::OnGetAdapter, 482 base::Bind(&BluetoothHostPairingController::OnGetAdapter,
483 ptr_factory_.GetWeakPtr())); 483 ptr_factory_.GetWeakPtr()));
484 } 484 }
485 485
486 std::string BluetoothHostPairingController::GetDeviceName() { 486 std::string BluetoothHostPairingController::GetDeviceName() {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION); 577 ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION);
578 } 578 }
579 579
580 void BluetoothHostPairingController::AuthorizePairing( 580 void BluetoothHostPairingController::AuthorizePairing(
581 device::BluetoothDevice* device) { 581 device::BluetoothDevice* device) {
582 // Disallow unknown device. 582 // Disallow unknown device.
583 device->RejectPairing(); 583 device->RejectPairing();
584 } 584 }
585 585
586 } // namespace pairing_chromeos 586 } // namespace pairing_chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698