| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <utility> |
| 6 |
| 5 #include "base/files/file.h" | 7 #include "base/files/file.h" |
| 6 #include "base/macros.h" | 8 #include "base/macros.h" |
| 7 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 9 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
| 10 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 11 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/chromeos/file_system_provider/notification_manager_inte
rface.h" | 14 #include "chrome/browser/chromeos/file_system_provider/notification_manager_inte
rface.h" |
| 13 #include "chrome/browser/chromeos/file_system_provider/observer.h" | 15 #include "chrome/browser/chromeos/file_system_provider/observer.h" |
| 14 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" | 16 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 ProvidedFileSystemInterface* const file_system = | 94 ProvidedFileSystemInterface* const file_system = |
| 93 service_->GetProvidedFileSystem(file_system_info.extension_id(), | 95 service_->GetProvidedFileSystem(file_system_info.extension_id(), |
| 94 file_system_info.file_system_id()); | 96 file_system_info.file_system_id()); |
| 95 DCHECK(file_system); | 97 DCHECK(file_system); |
| 96 file_system->GetRequestManager()->SetTimeoutForTesting(base::TimeDelta()); | 98 file_system->GetRequestManager()->SetTimeoutForTesting(base::TimeDelta()); |
| 97 | 99 |
| 98 scoped_ptr<NotificationButtonClicker> clicker( | 100 scoped_ptr<NotificationButtonClicker> clicker( |
| 99 new NotificationButtonClicker(file_system->GetFileSystemInfo())); | 101 new NotificationButtonClicker(file_system->GetFileSystemInfo())); |
| 100 | 102 |
| 101 file_system->GetRequestManager()->AddObserver(clicker.get()); | 103 file_system->GetRequestManager()->AddObserver(clicker.get()); |
| 102 clickers_.push_back(clicker.Pass()); | 104 clickers_.push_back(std::move(clicker)); |
| 103 } | 105 } |
| 104 | 106 |
| 105 void OnProvidedFileSystemUnmount( | 107 void OnProvidedFileSystemUnmount( |
| 106 const ProvidedFileSystemInfo& file_system_info, | 108 const ProvidedFileSystemInfo& file_system_info, |
| 107 base::File::Error error) override {} | 109 base::File::Error error) override {} |
| 108 | 110 |
| 109 private: | 111 private: |
| 110 Service* service_; // Not owned. | 112 Service* service_; // Not owned. |
| 111 ScopedVector<NotificationButtonClicker> clickers_; | 113 ScopedVector<NotificationButtonClicker> clickers_; |
| 112 DISALLOW_COPY_AND_ASSIGN(AbortOnUnresponsivePerformer); | 114 DISALLOW_COPY_AND_ASSIGN(AbortOnUnresponsivePerformer); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 281 } |
| 280 | 282 |
| 281 IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, Unresponsive_App) { | 283 IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, Unresponsive_App) { |
| 282 AbortOnUnresponsivePerformer performer(browser()->profile()); | 284 AbortOnUnresponsivePerformer performer(browser()->profile()); |
| 283 ASSERT_TRUE(RunPlatformAppTestWithFlags( | 285 ASSERT_TRUE(RunPlatformAppTestWithFlags( |
| 284 "file_system_provider/unresponsive_app", kFlagLoadAsComponent)) | 286 "file_system_provider/unresponsive_app", kFlagLoadAsComponent)) |
| 285 << message_; | 287 << message_; |
| 286 } | 288 } |
| 287 | 289 |
| 288 } // namespace extensions | 290 } // namespace extensions |
| OLD | NEW |