| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/drive/drive_integration_service.h" | 5 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 DCHECK(mount_points); | 458 DCHECK(mount_points); |
| 459 | 459 |
| 460 bool success = | 460 bool success = |
| 461 mount_points->RegisterFileSystem(mount_point_name_, | 461 mount_points->RegisterFileSystem(mount_point_name_, |
| 462 storage::kFileSystemTypeDrive, | 462 storage::kFileSystemTypeDrive, |
| 463 storage::FileSystemMountOption(), | 463 storage::FileSystemMountOption(), |
| 464 drive_mount_point); | 464 drive_mount_point); |
| 465 | 465 |
| 466 if (success) { | 466 if (success) { |
| 467 logger_->Log(logging::LOG_INFO, "Drive mount point is added"); | 467 logger_->Log(logging::LOG_INFO, "Drive mount point is added"); |
| 468 FOR_EACH_OBSERVER(DriveIntegrationServiceObserver, observers_, | 468 for (auto& observer : observers_) |
| 469 OnFileSystemMounted()); | 469 observer.OnFileSystemMounted(); |
| 470 } | 470 } |
| 471 } | 471 } |
| 472 | 472 |
| 473 void DriveIntegrationService::RemoveDriveMountPoint() { | 473 void DriveIntegrationService::RemoveDriveMountPoint() { |
| 474 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 474 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 475 | 475 |
| 476 if (!mount_point_name_.empty()) { | 476 if (!mount_point_name_.empty()) { |
| 477 job_list()->CancelAllJobs(); | 477 job_list()->CancelAllJobs(); |
| 478 | 478 |
| 479 FOR_EACH_OBSERVER(DriveIntegrationServiceObserver, observers_, | 479 for (auto& observer : observers_) |
| 480 OnFileSystemBeingUnmounted()); | 480 observer.OnFileSystemBeingUnmounted(); |
| 481 | 481 |
| 482 storage::ExternalMountPoints* const mount_points = | 482 storage::ExternalMountPoints* const mount_points = |
| 483 storage::ExternalMountPoints::GetSystemInstance(); | 483 storage::ExternalMountPoints::GetSystemInstance(); |
| 484 DCHECK(mount_points); | 484 DCHECK(mount_points); |
| 485 | 485 |
| 486 mount_points->RevokeFileSystem(mount_point_name_); | 486 mount_points->RevokeFileSystem(mount_point_name_); |
| 487 logger_->Log(logging::LOG_INFO, "Drive mount point is removed"); | 487 logger_->Log(logging::LOG_INFO, "Drive mount point is removed"); |
| 488 } | 488 } |
| 489 } | 489 } |
| 490 | 490 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 profile, preference_watcher, | 664 profile, preference_watcher, |
| 665 NULL, std::string(), base::FilePath(), NULL); | 665 NULL, std::string(), base::FilePath(), NULL); |
| 666 } else { | 666 } else { |
| 667 service = factory_for_test_->Run(profile); | 667 service = factory_for_test_->Run(profile); |
| 668 } | 668 } |
| 669 | 669 |
| 670 return service; | 670 return service; |
| 671 } | 671 } |
| 672 | 672 |
| 673 } // namespace drive | 673 } // namespace drive |
| OLD | NEW |