| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/arc/arc_auth_service.h" | 5 #include "chrome/browser/chromeos/arc/arc_auth_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/shelf/shelf_delegate.h" | 9 #include "ash/shelf/shelf_delegate.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 // static | 120 // static |
| 121 void ArcAuthService::RegisterProfilePrefs( | 121 void ArcAuthService::RegisterProfilePrefs( |
| 122 user_prefs::PrefRegistrySyncable* registry) { | 122 user_prefs::PrefRegistrySyncable* registry) { |
| 123 registry->RegisterBooleanPref( | 123 registry->RegisterBooleanPref( |
| 124 prefs::kArcEnabled, false, | 124 prefs::kArcEnabled, false, |
| 125 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 125 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 126 registry->RegisterBooleanPref(prefs::kArcSignedIn, false); | 126 registry->RegisterBooleanPref(prefs::kArcSignedIn, false); |
| 127 registry->RegisterBooleanPref(prefs::kArcBackupRestoreEnabled, true); | 127 registry->RegisterBooleanPref(prefs::kArcBackupRestoreEnabled, true); |
| 128 registry->RegisterBooleanPref(prefs::kArcLocationServiceEnabled, true); |
| 128 } | 129 } |
| 129 | 130 |
| 130 // static | 131 // static |
| 131 void ArcAuthService::DisableUIForTesting() { | 132 void ArcAuthService::DisableUIForTesting() { |
| 132 g_disable_ui_for_testing = true; | 133 g_disable_ui_for_testing = true; |
| 133 } | 134 } |
| 134 | 135 |
| 135 // static | 136 // static |
| 136 void ArcAuthService::SetShelfDelegateForTesting( | 137 void ArcAuthService::SetShelfDelegateForTesting( |
| 137 ash::ShelfDelegate* shelf_delegate) { | 138 ash::ShelfDelegate* shelf_delegate) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 !profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) { | 249 !profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) { |
| 249 playstore_launcher_.reset( | 250 playstore_launcher_.reset( |
| 250 new ArcAppLauncher(profile_, kPlayStoreAppId, true)); | 251 new ArcAppLauncher(profile_, kPlayStoreAppId, true)); |
| 251 } | 252 } |
| 252 | 253 |
| 253 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); | 254 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); |
| 254 CloseUI(); | 255 CloseUI(); |
| 255 UpdateProvisioningTiming(base::Time::Now() - sign_in_time_, true, | 256 UpdateProvisioningTiming(base::Time::Now() - sign_in_time_, true, |
| 256 IsAccountManaged(profile_)); | 257 IsAccountManaged(profile_)); |
| 257 UpdateProvisioningResultUMA(ProvisioningResult::SUCCESS); | 258 UpdateProvisioningResultUMA(ProvisioningResult::SUCCESS); |
| 259 |
| 260 FOR_EACH_OBSERVER(Observer, observer_list_, OnInitialStart()); |
| 258 } | 261 } |
| 259 | 262 |
| 260 void ArcAuthService::OnSignInFailed(arc::mojom::ArcSignInFailureReason reason) { | 263 void ArcAuthService::OnSignInFailed(arc::mojom::ArcSignInFailureReason reason) { |
| 261 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 264 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 262 DCHECK_EQ(state_, State::ACTIVE); | 265 DCHECK_EQ(state_, State::ACTIVE); |
| 263 DCHECK(!sign_in_time_.is_null()); | 266 DCHECK(!sign_in_time_.is_null()); |
| 264 | 267 |
| 265 waiting_for_reply_ = false; | 268 waiting_for_reply_ = false; |
| 266 | 269 |
| 267 UpdateProvisioningTiming(base::Time::Now() - sign_in_time_, false, | 270 UpdateProvisioningTiming(base::Time::Now() - sign_in_time_, false, |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 return os << kStateFetchingCode; | 765 return os << kStateFetchingCode; |
| 763 case ArcAuthService::State::ACTIVE: | 766 case ArcAuthService::State::ACTIVE: |
| 764 return os << kStateActive; | 767 return os << kStateActive; |
| 765 default: | 768 default: |
| 766 NOTREACHED(); | 769 NOTREACHED(); |
| 767 return os; | 770 return os; |
| 768 } | 771 } |
| 769 } | 772 } |
| 770 | 773 |
| 771 } // namespace arc | 774 } // namespace arc |
| OLD | NEW |