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

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

Issue 2215993002: Allow changing metrics reporting state without callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 } else if (IsControllerDetected()) { 625 } else if (IsControllerDetected()) {
626 ShowHostPairingScreen(); 626 ShowHostPairingScreen();
627 } else { 627 } else {
628 ShowAutoEnrollmentCheckScreen(); 628 ShowAutoEnrollmentCheckScreen();
629 } 629 }
630 } 630 }
631 631
632 void WizardController::OnEulaAccepted() { 632 void WizardController::OnEulaAccepted() {
633 time_eula_accepted_ = base::Time::Now(); 633 time_eula_accepted_ = base::Time::Now();
634 StartupUtils::MarkEulaAccepted(); 634 StartupUtils::MarkEulaAccepted();
635 InitiateMetricsReportingChange( 635 ChangeMetricsReportingStateWithReply(
636 usage_statistics_reporting_, 636 usage_statistics_reporting_,
637 base::Bind(&WizardController::InitiateMetricsReportingChangeCallback, 637 base::Bind(&WizardController::OnChangeMetricsReportingState,
638 weak_factory_.GetWeakPtr())); 638 weak_factory_.GetWeakPtr()));
639 PerformPostEulaActions(); 639 PerformPostEulaActions();
640 640
641 if (skip_update_enroll_after_eula_) { 641 if (skip_update_enroll_after_eula_) {
642 ShowAutoEnrollmentCheckScreen(); 642 ShowAutoEnrollmentCheckScreen();
643 } else { 643 } else {
644 InitiateOOBEUpdate(); 644 InitiateOOBEUpdate();
645 } 645 }
646 } 646 }
647 647
648 void WizardController::InitiateMetricsReportingChangeCallback(bool enabled) { 648 void WizardController::OnChangeMetricsReportingState(bool enabled) {
Ilya Sherman 2016/08/05 03:39:06 nit: Probably name this either "OnDidChange" or "O
gayane -on leave until 09-2017 2016/08/05 17:31:43 Done.
649 CrosSettings::Get()->SetBoolean(kStatsReportingPref, enabled); 649 CrosSettings::Get()->SetBoolean(kStatsReportingPref, enabled);
650 if (!enabled) 650 if (!enabled)
651 return; 651 return;
652 #if defined(GOOGLE_CHROME_BUILD) 652 #if defined(GOOGLE_CHROME_BUILD)
653 if (!content::BrowserThread::PostBlockingPoolTask( 653 if (!content::BrowserThread::PostBlockingPoolTask(
654 FROM_HERE, base::Bind(&InitializeCrashReporter))) { 654 FROM_HERE, base::Bind(&InitializeCrashReporter))) {
655 LOG(ERROR) << "Failed to start crash reporter initialization."; 655 LOG(ERROR) << "Failed to start crash reporter initialization.";
656 } 656 }
657 #endif 657 #endif
658 } 658 }
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; 1389 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT;
1390 } 1390 }
1391 1391
1392 EnrollmentScreen* screen = EnrollmentScreen::Get(this); 1392 EnrollmentScreen* screen = EnrollmentScreen::Get(this);
1393 screen->SetParameters(effective_config, shark_controller_.get()); 1393 screen->SetParameters(effective_config, shark_controller_.get());
1394 SetStatusAreaVisible(true); 1394 SetStatusAreaVisible(true);
1395 SetCurrentScreen(screen); 1395 SetCurrentScreen(screen);
1396 } 1396 }
1397 1397
1398 } // namespace chromeos 1398 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698