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

Unified Diff: chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.cc

Issue 2561023002: arc: ARC loading progress should not be shown when started from OOBE. (Closed)
Patch Set: cleanup Created 4 years 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/screens/arc_terms_of_service_screen.cc
diff --git a/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.cc b/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.cc
index 1da3072521b8c3086275456054483620c1aaf631..2c8b448ef2454ac6057379d307cfa3b5e7f6b301 100644
--- a/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.cc
+++ b/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h"
+#include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen_actor.h"
#include "chrome/browser/chromeos/login/screens/base_screen_delegate.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/metrics/metrics_reporting_state.h"
@@ -20,12 +21,12 @@ ArcTermsOfServiceScreen::ArcTermsOfServiceScreen(
: BaseScreen(base_screen_delegate), actor_(actor) {
DCHECK(actor_);
if (actor_)
- actor_->SetDelegate(this);
+ actor_->AddObserver(this);
}
ArcTermsOfServiceScreen::~ArcTermsOfServiceScreen() {
if (actor_)
- actor_->SetDelegate(nullptr);
+ actor_->RemoveObserver(this);
}
void ArcTermsOfServiceScreen::Show() {
@@ -56,7 +57,8 @@ void ArcTermsOfServiceScreen::OnAccept() {
void ArcTermsOfServiceScreen::ApplyTerms(bool accepted) {
Profile* profile = ProfileManager::GetActiveUserProfile();
profile->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, accepted);
hidehiko 2016/12/16 05:31:51 Looks a kind of race. Because both ArcTermsOfServi
khmel 2016/12/16 18:37:55 There is no race condition here. ArcTermsOfService
hidehiko 2016/12/19 15:49:44 Ah, maybe "race" was not a good word choice. Sorry
khmel 2016/12/19 17:48:10 I don't see any problem in order which are they ca
hidehiko 2016/12/20 15:20:45 I meant a test for this specific implementation. I
khmel 2016/12/20 16:27:57 Unit test that validates using OOBE negotiator alr
- profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, accepted);
+ if (!profile->GetPrefs()->IsManagedPreference(prefs::kArcEnabled))
hidehiko 2016/12/16 05:31:51 Is this check really needed?
khmel 2016/12/16 18:37:55 This prevents calling redundant OnOptInProfileChan
hidehiko 2016/12/19 15:49:44 According to the current implementation and commen
khmel 2016/12/19 17:48:10 I have no idea at this moment who calls this metho
hidehiko 2016/12/20 15:20:45 Even if there is similar code, code change for the
khmel 2016/12/20 16:27:57 I think investigation of this conceptual problem i
+ profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, accepted);
Finish(BaseScreenDelegate::ARC_TERMS_OF_SERVICE_FINISHED);
}

Powered by Google App Engine
This is Rietveld 408576698