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

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

Issue 1233453011: Revert of Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 adapter_->RemoveObserver(this); 64 adapter_->RemoveObserver(this);
65 adapter_ = NULL; 65 adapter_ = NULL;
66 } 66 }
67 } 67 }
68 68
69 void BluetoothControllerPairingController::DeviceFound( 69 void BluetoothControllerPairingController::DeviceFound(
70 device::BluetoothDevice* device) { 70 device::BluetoothDevice* device) {
71 DCHECK_EQ(current_stage_, STAGE_DEVICES_DISCOVERY); 71 DCHECK_EQ(current_stage_, STAGE_DEVICES_DISCOVERY);
72 DCHECK(thread_checker_.CalledOnValidThread()); 72 DCHECK(thread_checker_.CalledOnValidThread());
73 if (base::StartsWith(device->GetName(), base::ASCIIToUTF16(kDeviceNamePrefix), 73 if (base::StartsWith(device->GetName(), base::ASCIIToUTF16(kDeviceNamePrefix),
74 base::CompareCase::INSENSITIVE_ASCII)) { 74 false)) {
75 discovered_devices_.insert(device->GetAddress()); 75 discovered_devices_.insert(device->GetAddress());
76 FOR_EACH_OBSERVER(ControllerPairingController::Observer, observers_, 76 FOR_EACH_OBSERVER(ControllerPairingController::Observer, observers_,
77 DiscoveredDevicesListChanged()); 77 DiscoveredDevicesListChanged());
78 } 78 }
79 } 79 }
80 80
81 void BluetoothControllerPairingController::DeviceLost( 81 void BluetoothControllerPairingController::DeviceLost(
82 device::BluetoothDevice* device) { 82 device::BluetoothDevice* device) {
83 DCHECK_EQ(current_stage_, STAGE_DEVICES_DISCOVERY); 83 DCHECK_EQ(current_stage_, STAGE_DEVICES_DISCOVERY);
84 DCHECK(thread_checker_.CalledOnValidThread()); 84 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION); 476 ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION);
477 } 477 }
478 478
479 void BluetoothControllerPairingController::AuthorizePairing( 479 void BluetoothControllerPairingController::AuthorizePairing(
480 device::BluetoothDevice* device) { 480 device::BluetoothDevice* device) {
481 // Disallow unknown device. 481 // Disallow unknown device.
482 device->RejectPairing(); 482 device->RejectPairing();
483 } 483 }
484 484
485 } // namespace pairing_chromeos 485 } // namespace pairing_chromeos
OLDNEW
« no previous file with comments | « components/omnibox/browser/search_suggestion_parser.cc ('k') | components/password_manager/core/browser/password_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698