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

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

Issue 2017393002: bluetooth: Rename device's GetName to GetNameForDisplay (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_controller_pairing_controller.h" 5 #include "components/pairing/bluetooth_controller_pairing_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 if (adapter_.get()) { 65 if (adapter_.get()) {
66 adapter_->RemoveObserver(this); 66 adapter_->RemoveObserver(this);
67 adapter_ = NULL; 67 adapter_ = NULL;
68 } 68 }
69 } 69 }
70 70
71 void BluetoothControllerPairingController::DeviceFound( 71 void BluetoothControllerPairingController::DeviceFound(
72 device::BluetoothDevice* device) { 72 device::BluetoothDevice* device) {
73 DCHECK_EQ(current_stage_, STAGE_DEVICES_DISCOVERY); 73 DCHECK_EQ(current_stage_, STAGE_DEVICES_DISCOVERY);
74 DCHECK(thread_checker_.CalledOnValidThread()); 74 DCHECK(thread_checker_.CalledOnValidThread());
75 if (base::StartsWith(device->GetName(), base::ASCIIToUTF16(kDeviceNamePrefix), 75 if (base::StartsWith(device->GetNameForDisplay(),
76 base::ASCIIToUTF16(kDeviceNamePrefix),
76 base::CompareCase::INSENSITIVE_ASCII)) { 77 base::CompareCase::INSENSITIVE_ASCII)) {
77 discovered_devices_.insert(device->GetAddress()); 78 discovered_devices_.insert(device->GetAddress());
78 FOR_EACH_OBSERVER(ControllerPairingController::Observer, observers_, 79 FOR_EACH_OBSERVER(ControllerPairingController::Observer, observers_,
79 DiscoveredDevicesListChanged()); 80 DiscoveredDevicesListChanged());
80 } 81 }
81 } 82 }
82 83
83 void BluetoothControllerPairingController::DeviceLost( 84 void BluetoothControllerPairingController::DeviceLost(
84 device::BluetoothDevice* device) { 85 device::BluetoothDevice* device) {
85 DCHECK_EQ(current_stage_, STAGE_DEVICES_DISCOVERY); 86 DCHECK_EQ(current_stage_, STAGE_DEVICES_DISCOVERY);
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION); 500 ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION);
500 } 501 }
501 502
502 void BluetoothControllerPairingController::AuthorizePairing( 503 void BluetoothControllerPairingController::AuthorizePairing(
503 device::BluetoothDevice* device) { 504 device::BluetoothDevice* device) {
504 // Disallow unknown device. 505 // Disallow unknown device.
505 device->RejectPairing(); 506 device->RejectPairing();
506 } 507 }
507 508
508 } // namespace pairing_chromeos 509 } // namespace pairing_chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698