Roll libvpx 861f35:1fff3e
[chromium-blink-merge.git] / components / pairing / shark_connection_listener.cc
blobce63aa021b0ed640296fd1fdf3c9612458510566
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
3 // found in the LICENSE file.
5 #include "components/pairing/shark_connection_listener.h"
7 #include "base/logging.h"
8 #include "base/threading/thread_restrictions.h"
9 #include "components/pairing/bluetooth_host_pairing_controller.h"
11 namespace pairing_chromeos {
13 SharkConnectionListener::SharkConnectionListener(OnConnectedCallback callback)
14 : callback_(callback) {
15 controller_.reset(new BluetoothHostPairingController());
16 controller_->AddObserver(this);
17 controller_->StartPairing();
20 SharkConnectionListener::~SharkConnectionListener() {
21 if (controller_)
22 controller_->RemoveObserver(this);
25 void SharkConnectionListener::PairingStageChanged(Stage new_stage) {
26 if (new_stage == HostPairingController::STAGE_WAITING_FOR_CODE_CONFIRMATION) {
27 controller_->RemoveObserver(this);
28 callback_.Run(controller_.Pass());
29 callback_.Reset();
33 void SharkConnectionListener::ConfigureHost(
34 bool accepted_eula,
35 const std::string& lang,
36 const std::string& timezone,
37 bool send_reports,
38 const std::string& keyboard_layout) {
39 NOTREACHED();
42 void SharkConnectionListener::EnrollHost(const std::string& auth_token) {
43 NOTREACHED();
46 } // namespace pairing_chromeos