| Index: chrome/browser/chromeos/login/ownership_status_checker.cc
|
| diff --git a/chrome/browser/chromeos/login/ownership_status_checker.cc b/chrome/browser/chromeos/login/ownership_status_checker.cc
|
| index f7d67ab9399323a61d4f30aa145a19173fe5d09a..7e7a7e1519c0e6a9a0244b3b52ae2798d97f0e4b 100644
|
| --- a/chrome/browser/chromeos/login/ownership_status_checker.cc
|
| +++ b/chrome/browser/chromeos/login/ownership_status_checker.cc
|
| @@ -28,13 +28,16 @@ void OwnershipStatusChecker::Core::Check() {
|
| DCHECK(origin_loop_->BelongsToCurrentThread());
|
| OwnershipService::Status status =
|
| OwnershipService::GetSharedInstance()->GetStatus(false);
|
| - if (status != OwnershipService::OWNERSHIP_UNKNOWN) {
|
| + // We can only report the OWNERSHIP_NONE status without executing code on the
|
| + // file thread because checking whether the current user is owner needs file
|
| + // access.
|
| + if (status == OwnershipService::OWNERSHIP_NONE) {
|
| // Take a spin on the message loop in order to avoid reentrancy in callers.
|
| origin_loop_->PostTask(
|
| FROM_HERE,
|
| NewRunnableMethod(this,
|
| &OwnershipStatusChecker::Core::ReportResult,
|
| - status));
|
| + status, false));
|
| } else {
|
| // Switch to the file thread to make the blocking call.
|
| BrowserThread::PostTask(
|
| @@ -53,18 +56,20 @@ void OwnershipStatusChecker::Core::CheckOnFileThread() {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
|
| OwnershipService::Status status =
|
| OwnershipService::GetSharedInstance()->GetStatus(true);
|
| + bool current_user_is_owner =
|
| + OwnershipService::GetSharedInstance()->CurrentUserIsOwner();
|
| origin_loop_->PostTask(
|
| FROM_HERE,
|
| NewRunnableMethod(this,
|
| &OwnershipStatusChecker::Core::ReportResult,
|
| - status));
|
| + status, current_user_is_owner));
|
| }
|
|
|
| void OwnershipStatusChecker::Core::ReportResult(
|
| - OwnershipService::Status status) {
|
| + OwnershipService::Status status, bool current_user_is_owner) {
|
| DCHECK(origin_loop_->BelongsToCurrentThread());
|
| if (callback_.get()) {
|
| - callback_->Run(status);
|
| + callback_->Run(status, current_user_is_owner);
|
| callback_.reset();
|
| }
|
| }
|
|
|