| 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 if (!pref_service_syncable->IsSyncing()) | 389 if (!pref_service_syncable->IsSyncing()) |
| 390 return; | 390 return; |
| 391 | 391 |
| 392 pref_service_syncable->RemoveObserver(this); | 392 pref_service_syncable->RemoveObserver(this); |
| 393 | 393 |
| 394 if (IsArcEnabled()) | 394 if (IsArcEnabled()) |
| 395 OnOptInPreferenceChanged(); | 395 OnOptInPreferenceChanged(); |
| 396 | 396 |
| 397 if (!g_disable_ui_for_testing && profile_->IsNewProfile() && | 397 if (!g_disable_ui_for_testing && profile_->IsNewProfile() && |
| 398 !profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled)) { | 398 !profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled)) { |
| 399 ArcAuthNotification::Show(); | 399 ArcAuthNotification::Show(profile_); |
| 400 } | 400 } |
| 401 } | 401 } |
| 402 | 402 |
| 403 void ArcAuthService::Shutdown() { | 403 void ArcAuthService::Shutdown() { |
| 404 ShutdownBridgeAndCloseUI(); | 404 ShutdownBridgeAndCloseUI(); |
| 405 if (profile_) { | 405 if (profile_) { |
| 406 syncable_prefs::PrefServiceSyncable* pref_service_syncable = | 406 syncable_prefs::PrefServiceSyncable* pref_service_syncable = |
| 407 PrefServiceSyncableFromProfile(profile_); | 407 PrefServiceSyncableFromProfile(profile_); |
| 408 pref_service_syncable->RemoveObserver(this); | 408 pref_service_syncable->RemoveObserver(this); |
| 409 pref_service_syncable->RemoveSyncedPrefObserver(prefs::kArcEnabled, this); | 409 pref_service_syncable->RemoveSyncedPrefObserver(prefs::kArcEnabled, this); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 return os << kStateFetchingCode; | 751 return os << kStateFetchingCode; |
| 752 case ArcAuthService::State::ACTIVE: | 752 case ArcAuthService::State::ACTIVE: |
| 753 return os << kStateActive; | 753 return os << kStateActive; |
| 754 default: | 754 default: |
| 755 NOTREACHED(); | 755 NOTREACHED(); |
| 756 return os; | 756 return os; |
| 757 } | 757 } |
| 758 } | 758 } |
| 759 | 759 |
| 760 } // namespace arc | 760 } // namespace arc |
| OLD | NEW |