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

Side by Side Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 2498613003: Add ARC++ kiosk menu items and ability to start kiosk session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments + unit test build fix. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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,
439 policy_util::IsAccountManaged(profile_));
439 account_info_notifier_.reset(); 440 account_info_notifier_.reset();
440 } 441 }
441 442
442 bool ArcAuthService::IsAuthCodeRequest() const { 443 bool ArcAuthService::IsAuthCodeRequest() const {
443 return account_info_notifier_ != nullptr; 444 return account_info_notifier_ != nullptr;
444 } 445 }
445 446
446 void ArcAuthService::PrepareContextForAuthCodeRequest() { 447 void ArcAuthService::PrepareContextForAuthCodeRequest() {
447 // Requesting auth code on demand happens in following cases: 448 // Requesting auth code on demand happens in following cases:
448 // 1. To handle account password revoke. 449 // 1. To handle account password revoke.
(...skipping 17 matching lines...) Expand all
466 UpdateProvisioningResultUMA(ProvisioningResult::SUCCESS, 467 UpdateProvisioningResultUMA(ProvisioningResult::SUCCESS,
467 policy_util::IsAccountManaged(profile_)); 468 policy_util::IsAccountManaged(profile_));
468 } 469 }
469 470
470 CloseUI(); 471 CloseUI();
471 472
472 if (profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) 473 if (profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn))
473 return; 474 return;
474 475
475 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); 476 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true);
476 if (!IsOptInVerificationDisabled()) { 477 // Don't show Play Store app for ARC Kiosk because the only one UI in kiosk
Nikita (slow) 2016/11/16 14:37:21 What would be the way to debug Play Store then? I
Sergey Poromov 2016/11/16 15:06:21 This code auto-starts Play Store app on first sign
478 // mode must be the kiosk app and device is not needed for opt-in.
479 if (!IsOptInVerificationDisabled() && !IsArcKioskMode()) {
477 playstore_launcher_.reset( 480 playstore_launcher_.reset(
478 new ArcAppLauncher(profile_, kPlayStoreAppId, true)); 481 new ArcAppLauncher(profile_, kPlayStoreAppId, true));
479 } 482 }
480 483
481 for (auto& observer : observer_list_) 484 for (auto& observer : observer_list_)
482 observer.OnInitialStart(); 485 observer.OnInitialStart();
483 } 486 }
484 487
485 void ArcAuthService::OnSignInFailed(mojom::ArcSignInFailureReason reason) { 488 void ArcAuthService::OnSignInFailed(mojom::ArcSignInFailureReason reason) {
486 OnSignInFailedInternal( 489 OnSignInFailedInternal(
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 return os << "FETCHING_CODE"; 1149 return os << "FETCHING_CODE";
1147 case ArcAuthService::State::ACTIVE: 1150 case ArcAuthService::State::ACTIVE:
1148 return os << "ACTIVE"; 1151 return os << "ACTIVE";
1149 default: 1152 default:
1150 NOTREACHED(); 1153 NOTREACHED();
1151 return os; 1154 return os;
1152 } 1155 }
1153 } 1156 }
1154 1157
1155 } // namespace arc 1158 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698