Chromium Code Reviews| 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 fc8d785512f09f6b8ef43f2ecae4ff42874035b4..90679ea6afb036c28a8162282ee6951d93c9dae7 100644 |
| --- a/chrome/browser/chromeos/login/wizard_controller.cc |
| +++ b/chrome/browser/chromeos/login/wizard_controller.cc |
| @@ -90,6 +90,7 @@ |
| #include "components/user_manager/user_manager.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/notification_types.h" |
| +#include "dbus/message.h" |
| #include "ui/base/accelerators/accelerator.h" |
| using content::BrowserThread; |
| @@ -889,6 +890,28 @@ void WizardController::InitiateOOBEUpdate() { |
| return; |
| } |
| + // If this is a Cellular First device, instruct UpdateEngine to allow |
| + // updates over cellular data connections. |
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
|
xiyuan
2017/02/14 17:06:10
nit: Move this block into a help function (e.g. Ma
kumarniranjan
2017/02/28 19:01:39
I decided to name it IsCellularFirstDevice because
|
| + chromeos::switches::kCellularFirst)) { |
| + std::unique_ptr<dbus::Response> response = |
| + DBusThreadManager::Get() |
| + ->GetUpdateEngineClient() |
| + ->SetUpdateOverCellularPermission(true); |
| + switch (response->GetMessageType()) { |
| + case dbus::Message::MESSAGE_ERROR: |
| + LOG(ERROR) << "DBus Error: " << response->ToString(); |
| + // Intentional fallthrough. |
| + case dbus::Message::MESSAGE_INVALID: |
| + // MESSAGE_INVALID means the DBus response cannot be parsed. |
| + LOG(ERROR) << "Failed to set UpdateEngine to allow updates over cell."; |
| + break; |
| + default: |
| + VLOG(1) << "Successfully set UpdateEngine to allow update over cell."; |
| + break; |
| + } |
| + } |
| + |
| VLOG(1) << "InitiateOOBEUpdate"; |
| SetCurrentScreenSmooth(GetScreen(OobeScreen::SCREEN_OOBE_UPDATE), true); |
| UpdateScreen::Get(this)->StartNetworkCheck(); |