Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 } | 177 } |
| 178 | 178 |
| 179 bool IsSharkRequisition() { | 179 bool IsSharkRequisition() { |
| 180 policy::DeviceCloudPolicyManagerChromeOS* policy_manager = | 180 policy::DeviceCloudPolicyManagerChromeOS* policy_manager = |
| 181 g_browser_process->platform_part() | 181 g_browser_process->platform_part() |
| 182 ->browser_policy_connector_chromeos() | 182 ->browser_policy_connector_chromeos() |
| 183 ->GetDeviceCloudPolicyManager(); | 183 ->GetDeviceCloudPolicyManager(); |
| 184 return policy_manager && policy_manager->IsSharkRequisition(); | 184 return policy_manager && policy_manager->IsSharkRequisition(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 bool IsCellularFirstDevice() { | |
|
xiyuan
2017/02/28 20:26:41
Maybe we should move this into chromeos_swithces.h
kumarniranjan
2017/02/28 21:49:33
Done.
| |
| 188 return base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 189 chromeos::switches::kCellularFirst); | |
| 190 } | |
| 191 | |
| 187 // Checks if a controller device ("Master") is detected during the bootstrapping | 192 // Checks if a controller device ("Master") is detected during the bootstrapping |
| 188 // or shark/remora setup process. | 193 // or shark/remora setup process. |
| 189 bool IsControllerDetected() { | 194 bool IsControllerDetected() { |
| 190 return g_browser_process->local_state()->GetBoolean( | 195 return g_browser_process->local_state()->GetBoolean( |
| 191 prefs::kOobeControllerDetected); | 196 prefs::kOobeControllerDetected); |
| 192 } | 197 } |
| 193 | 198 |
| 194 void SetControllerDetectedPref(bool value) { | 199 void SetControllerDetectedPref(bool value) { |
| 195 PrefService* prefs = g_browser_process->local_state(); | 200 PrefService* prefs = g_browser_process->local_state(); |
| 196 prefs->SetBoolean(prefs::kOobeControllerDetected, value); | 201 prefs->SetBoolean(prefs::kOobeControllerDetected, value); |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 883 } | 888 } |
| 884 } | 889 } |
| 885 | 890 |
| 886 void WizardController::InitiateOOBEUpdate() { | 891 void WizardController::InitiateOOBEUpdate() { |
| 887 if (IsRemoraRequisition()) { | 892 if (IsRemoraRequisition()) { |
| 888 VLOG(1) << "Skip OOBE Update for remora."; | 893 VLOG(1) << "Skip OOBE Update for remora."; |
| 889 OnUpdateCompleted(); | 894 OnUpdateCompleted(); |
| 890 return; | 895 return; |
| 891 } | 896 } |
| 892 | 897 |
| 898 // If this is a Cellular First device, instruct UpdateEngine to allow | |
| 899 // updates over cellular data connections. | |
| 900 if (IsCellularFirstDevice()) { | |
| 901 DBusThreadManager::Get() | |
| 902 ->GetUpdateEngineClient() | |
| 903 ->SetUpdateOverCellularPermission( | |
| 904 true, base::Bind(&WizardController::InitiateOOBEUpdateHelper, | |
| 905 weak_factory_.GetWeakPtr())); | |
| 906 } else { | |
| 907 InitiateOOBEUpdateHelper(); | |
| 908 } | |
| 909 } | |
| 910 | |
| 911 void WizardController::InitiateOOBEUpdateHelper() { | |
| 893 VLOG(1) << "InitiateOOBEUpdate"; | 912 VLOG(1) << "InitiateOOBEUpdate"; |
| 894 SetCurrentScreenSmooth(GetScreen(OobeScreen::SCREEN_OOBE_UPDATE), true); | 913 SetCurrentScreenSmooth(GetScreen(OobeScreen::SCREEN_OOBE_UPDATE), true); |
| 895 UpdateScreen::Get(this)->StartNetworkCheck(); | 914 UpdateScreen::Get(this)->StartNetworkCheck(); |
| 896 } | 915 } |
| 897 | 916 |
| 898 void WizardController::StartTimezoneResolve() { | 917 void WizardController::StartTimezoneResolve() { |
| 899 geolocation_provider_.reset(new SimpleGeolocationProvider( | 918 geolocation_provider_.reset(new SimpleGeolocationProvider( |
| 900 g_browser_process->system_request_context(), | 919 g_browser_process->system_request_context(), |
| 901 SimpleGeolocationProvider::DefaultGeolocationProviderURL())); | 920 SimpleGeolocationProvider::DefaultGeolocationProviderURL())); |
| 902 geolocation_provider_->RequestGeolocation( | 921 geolocation_provider_->RequestGeolocation( |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1508 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; | 1527 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; |
| 1509 } | 1528 } |
| 1510 | 1529 |
| 1511 EnrollmentScreen* screen = EnrollmentScreen::Get(this); | 1530 EnrollmentScreen* screen = EnrollmentScreen::Get(this); |
| 1512 screen->SetParameters(effective_config, shark_controller_.get()); | 1531 screen->SetParameters(effective_config, shark_controller_.get()); |
| 1513 SetStatusAreaVisible(true); | 1532 SetStatusAreaVisible(true); |
| 1514 SetCurrentScreen(screen); | 1533 SetCurrentScreen(screen); |
| 1515 } | 1534 } |
| 1516 | 1535 |
| 1517 } // namespace chromeos | 1536 } // namespace chromeos |
| OLD | NEW |