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

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 524903003: Use shark requisition instead of command line parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix 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 | chromeos/chromeos_switches.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/wizard_controller.h" 5 #include "chrome/browser/chromeos/login/wizard_controller.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "chrome/browser/chromeos/login/screens/update_screen.h" 45 #include "chrome/browser/chromeos/login/screens/update_screen.h"
46 #include "chrome/browser/chromeos/login/screens/user_image_screen.h" 46 #include "chrome/browser/chromeos/login/screens/user_image_screen.h"
47 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h" 47 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h"
48 #include "chrome/browser/chromeos/login/startup_utils.h" 48 #include "chrome/browser/chromeos/login/startup_utils.h"
49 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre en.h" 49 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre en.h"
50 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 50 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
51 #include "chrome/browser/chromeos/login/ui/oobe_display.h" 51 #include "chrome/browser/chromeos/login/ui/oobe_display.h"
52 #include "chrome/browser/chromeos/net/delay_network_call.h" 52 #include "chrome/browser/chromeos/net/delay_network_call.h"
53 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 53 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
54 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" 54 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h"
55 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
55 #include "chrome/browser/chromeos/settings/cros_settings.h" 56 #include "chrome/browser/chromeos/settings/cros_settings.h"
56 #include "chrome/browser/chromeos/timezone/timezone_provider.h" 57 #include "chrome/browser/chromeos/timezone/timezone_provider.h"
57 #include "chrome/browser/lifetime/application_lifetime.h" 58 #include "chrome/browser/lifetime/application_lifetime.h"
58 #include "chrome/browser/metrics/metrics_reporting_state.h" 59 #include "chrome/browser/metrics/metrics_reporting_state.h"
59 #include "chrome/browser/profiles/profile.h" 60 #include "chrome/browser/profiles/profile.h"
60 #include "chrome/browser/profiles/profile_manager.h" 61 #include "chrome/browser/profiles/profile_manager.h"
61 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" 62 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
62 #include "chrome/common/chrome_constants.h" 63 #include "chrome/common/chrome_constants.h"
63 #include "chrome/common/pref_names.h" 64 #include "chrome/common/pref_names.h"
64 #include "chromeos/audio/cras_audio_handler.h" 65 #include "chromeos/audio/cras_audio_handler.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 chromeos::WizardController::kTermsOfServiceScreenName, 99 chromeos::WizardController::kTermsOfServiceScreenName,
99 chromeos::WizardController::kAutoEnrollmentCheckScreenName 100 chromeos::WizardController::kAutoEnrollmentCheckScreenName
100 }; 101 };
101 102
102 // Checks flag for HID-detection screen show. 103 // Checks flag for HID-detection screen show.
103 bool CanShowHIDDetectionScreen() { 104 bool CanShowHIDDetectionScreen() {
104 return !CommandLine::ForCurrentProcess()->HasSwitch( 105 return !CommandLine::ForCurrentProcess()->HasSwitch(
105 chromeos::switches::kDisableHIDDetectionOnOOBE); 106 chromeos::switches::kDisableHIDDetectionOnOOBE);
106 } 107 }
107 108
108 bool ShouldShowControllerPairingScreen() {
109 return CommandLine::ForCurrentProcess()->HasSwitch(
110 chromeos::switches::kShowControllerPairingDemo);
111 }
112
113 bool ShouldShowHostPairingScreen() { 109 bool ShouldShowHostPairingScreen() {
114 return CommandLine::ForCurrentProcess()->HasSwitch( 110 return CommandLine::ForCurrentProcess()->HasSwitch(
115 chromeos::switches::kShowHostPairingDemo); 111 chromeos::switches::kShowHostPairingDemo);
116 } 112 }
117 113
118 bool IsResumableScreen(const std::string& screen) { 114 bool IsResumableScreen(const std::string& screen) {
119 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kResumableScreens); ++i) { 115 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kResumableScreens); ++i) {
120 if (screen == kResumableScreens[i]) 116 if (screen == kResumableScreens[i])
121 return true; 117 return true;
122 } 118 }
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 ShowLoginScreen(LoginScreenContext()); 621 ShowLoginScreen(LoginScreenContext());
626 } 622 }
627 623
628 void WizardController::OnConnectionFailed() { 624 void WizardController::OnConnectionFailed() {
629 // TODO(dpolukhin): show error message after login screen is displayed. 625 // TODO(dpolukhin): show error message after login screen is displayed.
630 ShowLoginScreen(LoginScreenContext()); 626 ShowLoginScreen(LoginScreenContext());
631 } 627 }
632 628
633 void WizardController::OnUpdateCompleted() { 629 void WizardController::OnUpdateCompleted() {
634 // TODO(dzhioev): place checks related to pairing in a proper place. 630 // TODO(dzhioev): place checks related to pairing in a proper place.
635 if (ShouldShowControllerPairingScreen()) { 631 if (g_browser_process->platform_part()->browser_policy_connector_chromeos()->
achuithb 2014/08/29 23:53:11 You'll probably hate me for saying this, but this
Zachary Kuznia 2014/09/03 00:01:59 Done.
632 GetDeviceCloudPolicyManager()->IsSharkRequisition()) {
636 ShowControllerPairingScreen(); 633 ShowControllerPairingScreen();
637 } else if (ShouldShowHostPairingScreen()) { 634 } else if (ShouldShowHostPairingScreen()) {
638 ShowHostPairingScreen(); 635 ShowHostPairingScreen();
639 } else if (!auth_token_.empty()) { 636 } else if (!auth_token_.empty()) {
640 // TODO(achuith): There is an issue with the auto enrollment check and 637 // TODO(achuith): There is an issue with the auto enrollment check and
641 // remote enrollment. crbug.com/403147. 638 // remote enrollment. crbug.com/403147.
642 ShowEnrollmentScreen(); 639 ShowEnrollmentScreen();
643 } else { 640 } else {
644 ShowAutoEnrollmentCheckScreen(); 641 ShowAutoEnrollmentCheckScreen();
645 } 642 }
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 if (ShouldAutoStartEnrollment() || ShouldRecoverEnrollment()) { 1291 if (ShouldAutoStartEnrollment() || ShouldRecoverEnrollment()) {
1295 StartupUtils::MarkEulaAccepted(); 1292 StartupUtils::MarkEulaAccepted();
1296 auth_token_ = token; 1293 auth_token_ = token;
1297 InitiateOOBEUpdate(); 1294 InitiateOOBEUpdate();
1298 } else { 1295 } else {
1299 LOG(WARNING) << "Not in device enrollment."; 1296 LOG(WARNING) << "Not in device enrollment.";
1300 } 1297 }
1301 } 1298 }
1302 1299
1303 } // namespace chromeos 1300 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/chromeos_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698