| 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 "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 130 } |
| 131 | 131 |
| 132 void ArcAuthService::OnSignInFailed(arc::ArcSignInFailureReason reason) { | 132 void ArcAuthService::OnSignInFailed(arc::ArcSignInFailureReason reason) { |
| 133 DCHECK(thread_checker_.CalledOnValidThread()); | 133 DCHECK(thread_checker_.CalledOnValidThread()); |
| 134 DCHECK_EQ(state_, State::ACTIVE); | 134 DCHECK_EQ(state_, State::ACTIVE); |
| 135 | 135 |
| 136 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false); | 136 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false); |
| 137 ShutdownBridgeAndCloseUI(); | 137 ShutdownBridgeAndCloseUI(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void ArcAuthService::GetIsAccountManaged( |
| 141 const GetIsAccountManagedCallback& callback) { |
| 142 DCHECK(thread_checker_.CalledOnValidThread()); |
| 143 // Stub for testing. TODO(phweiss): Implement correct behaviour. |
| 144 callback.Run(true); |
| 145 } |
| 146 |
| 140 void ArcAuthService::SetState(State state) { | 147 void ArcAuthService::SetState(State state) { |
| 141 if (state_ == state) | 148 if (state_ == state) |
| 142 return; | 149 return; |
| 143 state_ = state; | 150 state_ = state; |
| 144 FOR_EACH_OBSERVER(Observer, observer_list_, OnOptInChanged(state_)); | 151 FOR_EACH_OBSERVER(Observer, observer_list_, OnOptInChanged(state_)); |
| 145 } | 152 } |
| 146 | 153 |
| 147 void ArcAuthService::OnPrimaryUserProfilePrepared(Profile* profile) { | 154 void ArcAuthService::OnPrimaryUserProfilePrepared(Profile* profile) { |
| 148 DCHECK(profile && profile != profile_); | 155 DCHECK(profile && profile != profile_); |
| 149 DCHECK(thread_checker_.CalledOnValidThread()); | 156 DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 return os << kStateFetchingCode; | 391 return os << kStateFetchingCode; |
| 385 case ArcAuthService::State::ACTIVE: | 392 case ArcAuthService::State::ACTIVE: |
| 386 return os << kStateActive; | 393 return os << kStateActive; |
| 387 default: | 394 default: |
| 388 NOTREACHED(); | 395 NOTREACHED(); |
| 389 return os; | 396 return os; |
| 390 } | 397 } |
| 391 } | 398 } |
| 392 | 399 |
| 393 } // namespace arc | 400 } // namespace arc |
| OLD | NEW |