| 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 "chrome/browser/chromeos/extensions/file_manager/private_api_file_syste
m.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_file_syste
m.h" |
| 6 | 6 |
| 7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
| 8 #include <sys/statvfs.h> | 8 #include <sys/statvfs.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <utime.h> | 10 #include <utime.h> |
| 11 | 11 |
| 12 #include "base/posix/eintr_wrapper.h" | 12 #include "base/posix/eintr_wrapper.h" |
| 13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "base/task_runner_util.h" | 14 #include "base/task_runner_util.h" |
| 15 #include "base/threading/sequenced_worker_pool.h" | 15 #include "base/threading/sequenced_worker_pool.h" |
| 16 #include "chrome/browser/chromeos/drive/drive.pb.h" | 16 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| 17 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 17 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 18 #include "chrome/browser/chromeos/drive/file_system_interface.h" | 18 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
| 19 #include "chrome/browser/chromeos/drive/file_system_util.h" | 19 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 20 #include "chrome/browser/chromeos/extensions/file_manager/event_router.h" |
| 20 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_private_a
pi.h" | 21 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_private_a
pi.h" |
| 21 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_event_rou
ter.h" | |
| 22 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" | 22 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" |
| 23 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 23 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
| 24 #include "chrome/browser/chromeos/fileapi/file_system_backend.h" | 24 #include "chrome/browser/chromeos/fileapi/file_system_backend.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chromeos/disks/disk_mount_manager.h" | 26 #include "chromeos/disks/disk_mount_manager.h" |
| 27 #include "content/public/browser/browser_context.h" | 27 #include "content/public/browser/browser_context.h" |
| 28 #include "content/public/browser/child_process_security_policy.h" | 28 #include "content/public/browser/child_process_security_policy.h" |
| 29 #include "content/public/browser/render_process_host.h" | 29 #include "content/public/browser/render_process_host.h" |
| 30 #include "content/public/browser/render_view_host.h" | 30 #include "content/public/browser/render_view_host.h" |
| 31 #include "content/public/browser/storage_partition.h" | 31 #include "content/public/browser/storage_partition.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 | 334 |
| 335 AddFileWatchFunction::~AddFileWatchFunction() { | 335 AddFileWatchFunction::~AddFileWatchFunction() { |
| 336 } | 336 } |
| 337 | 337 |
| 338 void AddFileWatchFunction::PerformFileWatchOperation( | 338 void AddFileWatchFunction::PerformFileWatchOperation( |
| 339 const base::FilePath& local_path, | 339 const base::FilePath& local_path, |
| 340 const base::FilePath& virtual_path, | 340 const base::FilePath& virtual_path, |
| 341 const std::string& extension_id) { | 341 const std::string& extension_id) { |
| 342 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 342 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 343 | 343 |
| 344 FileManagerEventRouter* event_router = | 344 EventRouter* event_router = |
| 345 FileBrowserPrivateAPI::Get(profile_)->event_router(); | 345 FileBrowserPrivateAPI::Get(profile_)->event_router(); |
| 346 event_router->AddFileWatch( | 346 event_router->AddFileWatch( |
| 347 local_path, | 347 local_path, |
| 348 virtual_path, | 348 virtual_path, |
| 349 extension_id, | 349 extension_id, |
| 350 base::Bind(&AddFileWatchFunction::Respond, this)); | 350 base::Bind(&AddFileWatchFunction::Respond, this)); |
| 351 } | 351 } |
| 352 | 352 |
| 353 RemoveFileWatchFunction::RemoveFileWatchFunction() { | 353 RemoveFileWatchFunction::RemoveFileWatchFunction() { |
| 354 } | 354 } |
| 355 | 355 |
| 356 RemoveFileWatchFunction::~RemoveFileWatchFunction() { | 356 RemoveFileWatchFunction::~RemoveFileWatchFunction() { |
| 357 } | 357 } |
| 358 | 358 |
| 359 void RemoveFileWatchFunction::PerformFileWatchOperation( | 359 void RemoveFileWatchFunction::PerformFileWatchOperation( |
| 360 const base::FilePath& local_path, | 360 const base::FilePath& local_path, |
| 361 const base::FilePath& unused, | 361 const base::FilePath& unused, |
| 362 const std::string& extension_id) { | 362 const std::string& extension_id) { |
| 363 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 363 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 364 | 364 |
| 365 FileManagerEventRouter* event_router = | 365 EventRouter* event_router = |
| 366 FileBrowserPrivateAPI::Get(profile_)->event_router(); | 366 FileBrowserPrivateAPI::Get(profile_)->event_router(); |
| 367 event_router->RemoveFileWatch(local_path, extension_id); | 367 event_router->RemoveFileWatch(local_path, extension_id); |
| 368 Respond(true); | 368 Respond(true); |
| 369 } | 369 } |
| 370 | 370 |
| 371 SetLastModifiedFunction::SetLastModifiedFunction() { | 371 SetLastModifiedFunction::SetLastModifiedFunction() { |
| 372 } | 372 } |
| 373 | 373 |
| 374 SetLastModifiedFunction::~SetLastModifiedFunction() { | 374 SetLastModifiedFunction::~SetLastModifiedFunction() { |
| 375 } | 375 } |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 render_view_host(), profile(), GURL(volume_file_url)); | 592 render_view_host(), profile(), GURL(volume_file_url)); |
| 593 if (file_path.empty()) | 593 if (file_path.empty()) |
| 594 return false; | 594 return false; |
| 595 | 595 |
| 596 DiskMountManager::GetInstance()->FormatMountedDevice(file_path.value()); | 596 DiskMountManager::GetInstance()->FormatMountedDevice(file_path.value()); |
| 597 SendResponse(true); | 597 SendResponse(true); |
| 598 return true; | 598 return true; |
| 599 } | 599 } |
| 600 | 600 |
| 601 } // namespace file_manager | 601 } // namespace file_manager |
| OLD | NEW |