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

Side by Side Diff: chrome/browser/chromeos/login/screens/host_pairing_screen.cc

Issue 517023002: Switch to Bluetooth pairing API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « chrome/browser/chromeos/login/screens/controller_pairing_screen.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/chromeos/login/screens/host_pairing_screen.h" 5 #include "chrome/browser/chromeos/login/screens/host_pairing_screen.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/chromeos/login/wizard_controller.h" 8 #include "chrome/browser/chromeos/login/wizard_controller.h"
9 #include "chromeos/chromeos_switches.h" 9 #include "components/pairing/bluetooth_host_pairing_controller.h"
10 #include "components/pairing/fake_host_pairing_controller.h"
11 10
12 namespace chromeos { 11 namespace chromeos {
13 12
14 using namespace host_pairing; 13 using namespace host_pairing;
15 using namespace pairing_chromeos; 14 using namespace pairing_chromeos;
16 15
17 HostPairingScreen::HostPairingScreen(ScreenObserver* observer, 16 HostPairingScreen::HostPairingScreen(ScreenObserver* observer,
18 HostPairingScreenActor* actor) 17 HostPairingScreenActor* actor)
19 : WizardScreen(observer), 18 : WizardScreen(observer),
20 actor_(actor), 19 actor_(actor),
21 current_stage_(HostPairingController::STAGE_NONE) { 20 current_stage_(HostPairingController::STAGE_NONE) {
22 actor_->SetDelegate(this); 21 actor_->SetDelegate(this);
23 std::string controller_config = 22 controller_.reset(new BluetoothHostPairingController());
24 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
25 switches::kShowHostPairingDemo);
26 controller_.reset(new FakeHostPairingController(controller_config));
27 controller_->AddObserver(this); 23 controller_->AddObserver(this);
28 } 24 }
29 25
30 HostPairingScreen::~HostPairingScreen() { 26 HostPairingScreen::~HostPairingScreen() {
31 if (actor_) 27 if (actor_)
32 actor_->SetDelegate(NULL); 28 actor_->SetDelegate(NULL);
33 controller_->RemoveObserver(this); 29 controller_->RemoveObserver(this);
34 } 30 }
35 31
36 void HostPairingScreen::CommitContextChanges() { 32 void HostPairingScreen::CommitContextChanges() {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // TODO(zork,achuith): Enroll device, send error on error. 123 // TODO(zork,achuith): Enroll device, send error on error.
128 // (http://crbug.com/374990) 124 // (http://crbug.com/374990)
129 } 125 }
130 126
131 void HostPairingScreen::OnActorDestroyed(HostPairingScreenActor* actor) { 127 void HostPairingScreen::OnActorDestroyed(HostPairingScreenActor* actor) {
132 if (actor_ == actor) 128 if (actor_ == actor)
133 actor_ = NULL; 129 actor_ = NULL;
134 } 130 }
135 131
136 } // namespace chromeos 132 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screens/controller_pairing_screen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698