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

Unified Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 2694923005: Appropriate handling for Cellular First devices. (Closed)
Patch Set: now with tests Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/wizard_controller.cc
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc
index a5be676dd96b5d2a4fd8ebc160019636e0b73720..5cc297e11facb8f8107346bf9c0a559be8878345 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -184,6 +184,11 @@ bool IsSharkRequisition() {
return policy_manager && policy_manager->IsSharkRequisition();
}
+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.
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kCellularFirst);
+}
+
// Checks if a controller device ("Master") is detected during the bootstrapping
// or shark/remora setup process.
bool IsControllerDetected() {
@@ -890,6 +895,20 @@ void WizardController::InitiateOOBEUpdate() {
return;
}
+ // If this is a Cellular First device, instruct UpdateEngine to allow
+ // updates over cellular data connections.
+ if (IsCellularFirstDevice()) {
+ DBusThreadManager::Get()
+ ->GetUpdateEngineClient()
+ ->SetUpdateOverCellularPermission(
+ true, base::Bind(&WizardController::InitiateOOBEUpdateHelper,
+ weak_factory_.GetWeakPtr()));
+ } else {
+ InitiateOOBEUpdateHelper();
+ }
+}
+
+void WizardController::InitiateOOBEUpdateHelper() {
VLOG(1) << "InitiateOOBEUpdate";
SetCurrentScreenSmooth(GetScreen(OobeScreen::SCREEN_OOBE_UPDATE), true);
UpdateScreen::Get(this)->StartNetworkCheck();

Powered by Google App Engine
This is Rietveld 408576698