Chromium Code Reviews| Index: chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc |
| diff --git a/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc b/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc |
| index 46687431e3afcac62eb91ef5618c173a7eeede4a..9e914c16f9b9ebc06ccca3ee45277ad827f8a7a1 100644 |
| --- a/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc |
| +++ b/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc |
| @@ -29,17 +29,22 @@ ArcFileSystemOperationRunner::CreateForTesting( |
| // We can't use base::MakeUnique() here because we are calling a private |
| // constructor. |
| return base::WrapUnique<ArcFileSystemOperationRunner>( |
| - new ArcFileSystemOperationRunner(bridge_service, false)); |
| + new ArcFileSystemOperationRunner(bridge_service, nullptr, false)); |
| } |
| ArcFileSystemOperationRunner::ArcFileSystemOperationRunner( |
| - ArcBridgeService* bridge_service) |
| - : ArcFileSystemOperationRunner(bridge_service, true) {} |
| + ArcBridgeService* bridge_service, |
| + const Profile* profile) |
| + : ArcFileSystemOperationRunner(bridge_service, profile, true) { |
| + DCHECK(profile); |
| +} |
| ArcFileSystemOperationRunner::ArcFileSystemOperationRunner( |
| ArcBridgeService* bridge_service, |
| + const Profile* profile, |
| bool observe_events) |
|
hidehiko
2017/02/23 08:36:04
Optional: Just a random idea.
Now, because |profil
Shuhei Takahashi
2017/02/23 08:49:30
Indeed |profile_| is nullptr only in testing, but
|
| : ArcService(bridge_service), |
| + profile_(profile), |
| observe_events_(observe_events), |
| weak_ptr_factory_(this) { |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| @@ -162,11 +167,8 @@ void ArcFileSystemOperationRunner::OnInstanceClosed() { |
| void ArcFileSystemOperationRunner::OnStateChanged() { |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| - // TODO(hidehiko): Revisit the condition, when ARC is running without |
| - // profile. |
| - SetShouldDefer( |
| - IsArcPlayStoreEnabledForProfile(ArcSessionManager::Get()->profile()) && |
| - !arc_bridge_service()->file_system()->has_instance()); |
| + SetShouldDefer(IsArcPlayStoreEnabledForProfile(profile_) && |
| + !arc_bridge_service()->file_system()->has_instance()); |
| } |
| void ArcFileSystemOperationRunner::SetShouldDefer(bool should_defer) { |