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

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

Issue 2694923005: Appropriate handling for Cellular First devices. (Closed)
Patch Set: 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 unified diff | Download patch
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 <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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #include "chromeos/timezone/timezone_provider.h" 83 #include "chromeos/timezone/timezone_provider.h"
84 #include "components/crash/content/app/breakpad_linux.h" 84 #include "components/crash/content/app/breakpad_linux.h"
85 #include "components/pairing/bluetooth_controller_pairing_controller.h" 85 #include "components/pairing/bluetooth_controller_pairing_controller.h"
86 #include "components/pairing/bluetooth_host_pairing_controller.h" 86 #include "components/pairing/bluetooth_host_pairing_controller.h"
87 #include "components/pairing/shark_connection_listener.h" 87 #include "components/pairing/shark_connection_listener.h"
88 #include "components/prefs/pref_registry_simple.h" 88 #include "components/prefs/pref_registry_simple.h"
89 #include "components/prefs/pref_service.h" 89 #include "components/prefs/pref_service.h"
90 #include "components/user_manager/user_manager.h" 90 #include "components/user_manager/user_manager.h"
91 #include "content/public/browser/browser_thread.h" 91 #include "content/public/browser/browser_thread.h"
92 #include "content/public/browser/notification_types.h" 92 #include "content/public/browser/notification_types.h"
93 #include "dbus/message.h"
93 #include "ui/base/accelerators/accelerator.h" 94 #include "ui/base/accelerators/accelerator.h"
94 95
95 using content::BrowserThread; 96 using content::BrowserThread;
96 97
97 namespace { 98 namespace {
98 // Interval in ms which is used for smooth screen showing. 99 // Interval in ms which is used for smooth screen showing.
99 static int kShowDelayMs = 400; 100 static int kShowDelayMs = 400;
100 101
101 // Total timezone resolving process timeout. 102 // Total timezone resolving process timeout.
102 const unsigned int kResolveTimeZoneTimeoutSeconds = 60; 103 const unsigned int kResolveTimeZoneTimeoutSeconds = 60;
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 } 883 }
883 } 884 }
884 885
885 void WizardController::InitiateOOBEUpdate() { 886 void WizardController::InitiateOOBEUpdate() {
886 if (IsRemoraRequisition()) { 887 if (IsRemoraRequisition()) {
887 VLOG(1) << "Skip OOBE Update for remora."; 888 VLOG(1) << "Skip OOBE Update for remora.";
888 OnUpdateCompleted(); 889 OnUpdateCompleted();
889 return; 890 return;
890 } 891 }
891 892
893 // If this is a Cellular First device, instruct UpdateEngine to allow
894 // updates over cellular data connections.
895 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
896 chromeos::switches::kCellularFirst)) {
897 std::unique_ptr<dbus::Response> response =
898 DBusThreadManager::Get()
899 ->GetUpdateEngineClient()
900 ->SetUpdateOverCellularPermission(true);
901 switch (response->GetMessageType()) {
902 case dbus::Message::MESSAGE_ERROR:
903 LOG(ERROR) << "DBus Error: " << response->ToString();
904 // Intentional fallthrough.
905 case dbus::Message::MESSAGE_INVALID:
906 // MESSAGE_INVALID means the DBus response cannot be parsed.
907 LOG(ERROR) << "Failed to set UpdateEngine to allow updates over cell.";
908 break;
909 default:
910 VLOG(1) << "Successfully set UpdateEngine to allow update over cell.";
911 break;
912 }
913 }
914
892 VLOG(1) << "InitiateOOBEUpdate"; 915 VLOG(1) << "InitiateOOBEUpdate";
893 SetCurrentScreenSmooth(GetScreen(OobeScreen::SCREEN_OOBE_UPDATE), true); 916 SetCurrentScreenSmooth(GetScreen(OobeScreen::SCREEN_OOBE_UPDATE), true);
894 UpdateScreen::Get(this)->StartNetworkCheck(); 917 UpdateScreen::Get(this)->StartNetworkCheck();
895 } 918 }
896 919
897 void WizardController::StartTimezoneResolve() { 920 void WizardController::StartTimezoneResolve() {
898 geolocation_provider_.reset(new SimpleGeolocationProvider( 921 geolocation_provider_.reset(new SimpleGeolocationProvider(
899 g_browser_process->system_request_context(), 922 g_browser_process->system_request_context(),
900 SimpleGeolocationProvider::DefaultGeolocationProviderURL())); 923 SimpleGeolocationProvider::DefaultGeolocationProviderURL()));
901 geolocation_provider_->RequestGeolocation( 924 geolocation_provider_->RequestGeolocation(
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; 1529 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT;
1507 } 1530 }
1508 1531
1509 EnrollmentScreen* screen = EnrollmentScreen::Get(this); 1532 EnrollmentScreen* screen = EnrollmentScreen::Get(this);
1510 screen->SetParameters(effective_config, shark_controller_.get()); 1533 screen->SetParameters(effective_config, shark_controller_.get());
1511 SetStatusAreaVisible(true); 1534 SetStatusAreaVisible(true);
1512 SetCurrentScreen(screen); 1535 SetCurrentScreen(screen);
1513 } 1536 }
1514 1537
1515 } // namespace chromeos 1538 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698