| 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/gdata/gdata_system_service.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chromeos/gdata/drive_api_service.h" | 10 #include "chrome/browser/chromeos/gdata/drive_api_service.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 RemoveDriveMountPoint(); | 115 RemoveDriveMountPoint(); |
| 116 drive_service()->CancelAll(); | 116 drive_service()->CancelAll(); |
| 117 cache_->ClearAllOnUIThread( | 117 cache_->ClearAllOnUIThread( |
| 118 base::Bind(&GDataSystemService::AddBackDriveMountPoint, | 118 base::Bind(&GDataSystemService::AddBackDriveMountPoint, |
| 119 weak_ptr_factory_.GetWeakPtr(), | 119 weak_ptr_factory_.GetWeakPtr(), |
| 120 callback)); | 120 callback)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void GDataSystemService::AddBackDriveMountPoint( | 123 void GDataSystemService::AddBackDriveMountPoint( |
| 124 const base::Callback<void(bool)>& callback, | 124 const base::Callback<void(bool)>& callback, |
| 125 GDataFileError error, | 125 DriveFileError error, |
| 126 const FilePath& file_path) { | 126 const FilePath& file_path) { |
| 127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 128 | 128 |
| 129 AddDriveMountPoint(); | 129 AddDriveMountPoint(); |
| 130 | 130 |
| 131 if (!callback.is_null()) | 131 if (!callback.is_null()) |
| 132 callback.Run(error == GDATA_FILE_OK); | 132 callback.Run(error == DRIVE_FILE_OK); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void GDataSystemService::AddDriveMountPoint() { | 135 void GDataSystemService::AddDriveMountPoint() { |
| 136 if (!gdata::util::IsGDataAvailable(profile_)) | 136 if (!gdata::util::IsGDataAvailable(profile_)) |
| 137 return; | 137 return; |
| 138 | 138 |
| 139 const FilePath mount_point = gdata::util::GetGDataMountPointPath(); | 139 const FilePath mount_point = gdata::util::GetGDataMountPointPath(); |
| 140 fileapi::ExternalFileSystemMountPointProvider* provider = | 140 fileapi::ExternalFileSystemMountPointProvider* provider = |
| 141 BrowserContext::GetFileSystemContext(profile_)->external_provider(); | 141 BrowserContext::GetFileSystemContext(profile_)->external_provider(); |
| 142 if (provider && !provider->HasMountPoint(mount_point)) { | 142 if (provider && !provider->HasMountPoint(mount_point)) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 g_test_cache_root ? FilePath(*g_test_cache_root) : | 223 g_test_cache_root ? FilePath(*g_test_cache_root) : |
| 224 DriveCache::GetCacheRootPath(profile); | 224 DriveCache::GetCacheRootPath(profile); |
| 225 delete g_test_cache_root; | 225 delete g_test_cache_root; |
| 226 g_test_cache_root = NULL; | 226 g_test_cache_root = NULL; |
| 227 | 227 |
| 228 service->Initialize(drive_service, cache_root); | 228 service->Initialize(drive_service, cache_root); |
| 229 return service; | 229 return service; |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace gdata | 232 } // namespace gdata |
| OLD | NEW |