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

Side by Side Diff: chrome/browser/chromeos/login/screens/controller_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 | « no previous file | chrome/browser/chromeos/login/screens/host_pairing_screen.cc » ('j') | 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/controller_pairing_screen.h" 5 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/chromeos/login/wizard_controller.h" 9 #include "chrome/browser/chromeos/login/wizard_controller.h"
10 #include "chromeos/chromeos_switches.h" 10 #include "components/pairing/bluetooth_controller_pairing_controller.h"
11 #include "components/pairing/fake_controller_pairing_controller.h"
12 #include "google_apis/gaia/gaia_auth_util.h" 11 #include "google_apis/gaia/gaia_auth_util.h"
13 12
14 using namespace chromeos::controller_pairing; 13 using namespace chromeos::controller_pairing;
15 using namespace pairing_chromeos; 14 using namespace pairing_chromeos;
16 15
17 namespace { 16 namespace {
18 const char* kTestAuthToken = "TestAuthToken"; 17 const char* kTestAuthToken = "TestAuthToken";
19 }; 18 };
20 19
21 namespace chromeos { 20 namespace chromeos {
22 21
23 ControllerPairingScreen::ControllerPairingScreen( 22 ControllerPairingScreen::ControllerPairingScreen(
24 ScreenObserver* observer, 23 ScreenObserver* observer,
25 ControllerPairingScreenActor* actor) 24 ControllerPairingScreenActor* actor)
26 : WizardScreen(observer), 25 : WizardScreen(observer),
27 actor_(actor), 26 actor_(actor),
28 current_stage_(ControllerPairingController::STAGE_NONE), 27 current_stage_(ControllerPairingController::STAGE_NONE),
29 device_preselected_(false) { 28 device_preselected_(false) {
30 actor_->SetDelegate(this); 29 actor_->SetDelegate(this);
31 std::string controller_config = 30 controller_.reset(new BluetoothControllerPairingController());
32 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
33 switches::kShowControllerPairingDemo);
34 controller_.reset(new FakeControllerPairingController(controller_config));
35 controller_->AddObserver(this); 31 controller_->AddObserver(this);
36 } 32 }
37 33
38 ControllerPairingScreen::~ControllerPairingScreen() { 34 ControllerPairingScreen::~ControllerPairingScreen() {
39 if (actor_) 35 if (actor_)
40 actor_->SetDelegate(NULL); 36 actor_->SetDelegate(NULL);
41 controller_->RemoveObserver(this); 37 controller_->RemoveObserver(this);
42 } 38 }
43 39
44 void ControllerPairingScreen::CommitContextChanges() { 40 void ControllerPairingScreen::CommitContextChanges() {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 ++key) { 218 ++key) {
223 if (*key == kContextKeySelectedDevice) { 219 if (*key == kContextKeySelectedDevice) {
224 context_.SetBoolean(kContextKeyControlsDisabled, 220 context_.SetBoolean(kContextKeyControlsDisabled,
225 context_.GetString(*key).empty()); 221 context_.GetString(*key).empty());
226 CommitContextChanges(); 222 CommitContextChanges();
227 } 223 }
228 } 224 }
229 } 225 }
230 226
231 } // namespace chromeos 227 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/screens/host_pairing_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698