| 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_file_system.h" | 5 #include "chrome/browser/chromeos/drive/drive_file_system.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 } | 1291 } |
| 1292 | 1292 |
| 1293 void DriveFileSystem::OnInitialFeedLoaded() { | 1293 void DriveFileSystem::OnInitialFeedLoaded() { |
| 1294 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1294 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1295 | 1295 |
| 1296 FOR_EACH_OBSERVER(DriveFileSystemObserver, | 1296 FOR_EACH_OBSERVER(DriveFileSystemObserver, |
| 1297 observers_, | 1297 observers_, |
| 1298 OnInitialLoadFinished()); | 1298 OnInitialLoadFinished()); |
| 1299 } | 1299 } |
| 1300 | 1300 |
| 1301 void DriveFileSystem::NotifyFileSystemMounted() { | |
| 1302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
| 1303 | |
| 1304 DVLOG(1) << "File System is mounted"; | |
| 1305 // Notify the observers that the file system is mounted. | |
| 1306 FOR_EACH_OBSERVER(DriveFileSystemObserver, observers_, | |
| 1307 OnFileSystemMounted()); | |
| 1308 } | |
| 1309 | |
| 1310 void DriveFileSystem::NotifyFileSystemToBeUnmounted() { | |
| 1311 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
| 1312 | |
| 1313 DVLOG(1) << "File System is to be unmounted"; | |
| 1314 // Notify the observers that the file system is being unmounted. | |
| 1315 FOR_EACH_OBSERVER(DriveFileSystemObserver, observers_, | |
| 1316 OnFileSystemBeingUnmounted()); | |
| 1317 } | |
| 1318 | |
| 1319 void DriveFileSystem::AddUploadedFile( | 1301 void DriveFileSystem::AddUploadedFile( |
| 1320 scoped_ptr<google_apis::ResourceEntry> entry, | 1302 scoped_ptr<google_apis::ResourceEntry> entry, |
| 1321 const base::FilePath& file_content_path, | 1303 const base::FilePath& file_content_path, |
| 1322 const FileOperationCallback& callback) { | 1304 const FileOperationCallback& callback) { |
| 1323 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1305 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1324 DCHECK(entry.get()); | 1306 DCHECK(entry.get()); |
| 1325 DCHECK(!entry->resource_id().empty()); | 1307 DCHECK(!entry->resource_id().empty()); |
| 1326 DCHECK(!entry->file_md5().empty()); | 1308 DCHECK(!entry->file_md5().empty()); |
| 1327 DCHECK(!callback.is_null()); | 1309 DCHECK(!callback.is_null()); |
| 1328 | 1310 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1702 return; | 1684 return; |
| 1703 } | 1685 } |
| 1704 | 1686 |
| 1705 PlatformFileInfoProto entry_file_info; | 1687 PlatformFileInfoProto entry_file_info; |
| 1706 util::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); | 1688 util::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); |
| 1707 *entry_proto->mutable_file_info() = entry_file_info; | 1689 *entry_proto->mutable_file_info() = entry_file_info; |
| 1708 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); | 1690 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); |
| 1709 } | 1691 } |
| 1710 | 1692 |
| 1711 } // namespace drive | 1693 } // namespace drive |
| OLD | NEW |