Chromium Code Reviews| 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/common/shelf/shelf_delegate.h" | 9 #include "ash/common/shelf/shelf_delegate.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 426 arc_robot_auth_.reset(); | 426 arc_robot_auth_.reset(); |
| 427 | 427 |
| 428 if (robot_auth_code.empty()) { | 428 if (robot_auth_code.empty()) { |
| 429 VLOG(1) << "Robot account auth code fetching error"; | 429 VLOG(1) << "Robot account auth code fetching error"; |
| 430 // Log out the user. All the cleanup will be done in Shutdown() method. | 430 // Log out the user. All the cleanup will be done in Shutdown() method. |
| 431 // The callback is not called because auth code is empty. | 431 // The callback is not called because auth code is empty. |
| 432 chrome::AttemptUserExit(); | 432 chrome::AttemptUserExit(); |
| 433 return; | 433 return; |
| 434 } | 434 } |
| 435 | 435 |
| 436 account_info_notifier_->Notify( | 436 account_info_notifier_->Notify(!IsOptInVerificationDisabled(), |
| 437 !IsOptInVerificationDisabled(), robot_auth_code, | 437 robot_auth_code, |
| 438 mojom::ChromeAccountType::ROBOT_ACCOUNT, false); | 438 mojom::ChromeAccountType::ROBOT_ACCOUNT, true); |
|
peletskyi
2016/11/12 16:52:17
ArcAuthServiceBrowsertest must be fixed as well.
hidehiko
2016/11/14 05:29:24
policy_util::IsAccountManaged(profile_) looks bett
Sergey Poromov
2016/11/14 17:23:22
Done.
| |
| 439 account_info_notifier_.reset(); | 439 account_info_notifier_.reset(); |
| 440 } | 440 } |
| 441 | 441 |
| 442 bool ArcAuthService::IsAuthCodeRequest() const { | 442 bool ArcAuthService::IsAuthCodeRequest() const { |
| 443 return account_info_notifier_ != nullptr; | 443 return account_info_notifier_ != nullptr; |
| 444 } | 444 } |
| 445 | 445 |
| 446 void ArcAuthService::PrepareContextForAuthCodeRequest() { | 446 void ArcAuthService::PrepareContextForAuthCodeRequest() { |
| 447 // Requesting auth code on demand happens in following cases: | 447 // Requesting auth code on demand happens in following cases: |
| 448 // 1. To handle account password revoke. | 448 // 1. To handle account password revoke. |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 466 UpdateProvisioningResultUMA(ProvisioningResult::SUCCESS, | 466 UpdateProvisioningResultUMA(ProvisioningResult::SUCCESS, |
| 467 policy_util::IsAccountManaged(profile_)); | 467 policy_util::IsAccountManaged(profile_)); |
| 468 } | 468 } |
| 469 | 469 |
| 470 CloseUI(); | 470 CloseUI(); |
| 471 | 471 |
| 472 if (profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) | 472 if (profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) |
| 473 return; | 473 return; |
| 474 | 474 |
| 475 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); | 475 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); |
| 476 if (!IsOptInVerificationDisabled()) { | 476 if (!IsOptInVerificationDisabled() && !IsArcKioskMode()) { |
|
hidehiko
2016/11/14 05:29:24
Any comments?
Sergey Poromov
2016/11/14 17:23:22
Done.
| |
| 477 playstore_launcher_.reset( | 477 playstore_launcher_.reset( |
| 478 new ArcAppLauncher(profile_, kPlayStoreAppId, true)); | 478 new ArcAppLauncher(profile_, kPlayStoreAppId, true)); |
| 479 } | 479 } |
| 480 | 480 |
| 481 for (auto& observer : observer_list_) | 481 for (auto& observer : observer_list_) |
| 482 observer.OnInitialStart(); | 482 observer.OnInitialStart(); |
| 483 } | 483 } |
| 484 | 484 |
| 485 void ArcAuthService::OnSignInFailed(mojom::ArcSignInFailureReason reason) { | 485 void ArcAuthService::OnSignInFailed(mojom::ArcSignInFailureReason reason) { |
| 486 OnSignInFailedInternal( | 486 OnSignInFailedInternal( |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1146 return os << "FETCHING_CODE"; | 1146 return os << "FETCHING_CODE"; |
| 1147 case ArcAuthService::State::ACTIVE: | 1147 case ArcAuthService::State::ACTIVE: |
| 1148 return os << "ACTIVE"; | 1148 return os << "ACTIVE"; |
| 1149 default: | 1149 default: |
| 1150 NOTREACHED(); | 1150 NOTREACHED(); |
| 1151 return os; | 1151 return os; |
| 1152 } | 1152 } |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 } // namespace arc | 1155 } // namespace arc |
| OLD | NEW |