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

Unified Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 1925183004: arc_bridge: Add more logging, plus cleanup (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Fixed unit tests Created 4 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_policy_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_auth_service.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc
index 58f9a48b753f1bd729de483e9859e22e348e6e31..8d6653b1d60bc55a619f9ee5fab2e56b0af247d8 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/arc/arc_auth_service.h"
+#include <string>
#include <utility>
#include "base/bind.h"
@@ -224,9 +225,12 @@ void ArcAuthService::OnPrimaryUserProfilePrepared(Profile* profile) {
user_manager::User const* const user =
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
- if (profile->IsLegacySupervised() || !user->HasGaiaAccount()) {
- VLOG(2) << "Supervised users and users without GAIA accounts are not "
- "supported in Arc.";
+ if (profile->IsLegacySupervised()) {
+ VLOG(1) << "Supervised users are not supported in ARC.";
+ return;
+ }
+ if (!user->HasGaiaAccount()) {
+ VLOG(1) << "Users without GAIA accounts are not supported in ARC.";
return;
}
@@ -357,27 +361,28 @@ void ArcAuthService::OnOptInPreferenceChanged() {
DCHECK(thread_checker.Get().CalledOnValidThread());
DCHECK(profile_);
- if (profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled)) {
- if (state_ != State::ACTIVE) {
- CloseUI();
- auth_code_.clear();
-
- if (!profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) {
- // Need pre-fetch auth code and show OptIn UI if needed.
- initial_opt_in_ = true;
- StartUI();
- } else {
- // Ready to start Arc.
- StartArc();
- }
-
- UpdateEnabledStateUMA(true);
- }
- } else {
+ if (!profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled)) {
if (state_ != State::STOPPED)
UpdateEnabledStateUMA(false);
ShutdownBridgeAndCloseUI();
+ return;
}
+
+ if (state_ == State::ACTIVE)
+ return;
+ CloseUI();
+ auth_code_.clear();
+
+ if (!profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) {
+ // Need pre-fetch auth code and show OptIn UI if needed.
+ initial_opt_in_ = true;
+ StartUI();
+ } else {
+ // Ready to start Arc.
+ StartArc();
+ }
+
+ UpdateEnabledStateUMA(true);
}
void ArcAuthService::ShutdownBridge() {
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_policy_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698