| 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/file_system.h" | 5 #include "chrome/browser/chromeos/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/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 DVLOG(1) << "CheckForUpdates finished: " << FileErrorToString(error); | 394 DVLOG(1) << "CheckForUpdates finished: " << FileErrorToString(error); |
| 395 last_update_check_time_ = base::Time::Now(); | 395 last_update_check_time_ = base::Time::Now(); |
| 396 last_update_check_error_ = error; | 396 last_update_check_error_ = error; |
| 397 } | 397 } |
| 398 | 398 |
| 399 FileSystem::~FileSystem() { | 399 FileSystem::~FileSystem() { |
| 400 // This should be called from UI thread, from DriveIntegrationService | 400 // This should be called from UI thread, from DriveIntegrationService |
| 401 // shutdown. | 401 // shutdown. |
| 402 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 402 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 403 | 403 |
| 404 change_list_loader_->RemoveObserver(this); | 404 if (change_list_loader_) |
| 405 change_list_loader_->RemoveObserver(this); |
| 405 } | 406 } |
| 406 | 407 |
| 407 void FileSystem::AddObserver(FileSystemObserver* observer) { | 408 void FileSystem::AddObserver(FileSystemObserver* observer) { |
| 408 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 409 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 409 observers_.AddObserver(observer); | 410 observers_.AddObserver(observer); |
| 410 } | 411 } |
| 411 | 412 |
| 412 void FileSystem::RemoveObserver(FileSystemObserver* observer) { | 413 void FileSystem::RemoveObserver(FileSystemObserver* observer) { |
| 413 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 414 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 414 observers_.RemoveObserver(observer); | 415 observers_.RemoveObserver(observer); |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 if (util::IsSpecialResourceId(id)) | 1090 if (util::IsSpecialResourceId(id)) |
| 1090 return; | 1091 return; |
| 1091 | 1092 |
| 1092 util::Log(logging::LOG_INFO, | 1093 util::Log(logging::LOG_INFO, |
| 1093 "Thumbnail refresh for %s", directory_path.AsUTF8Unsafe().c_str()); | 1094 "Thumbnail refresh for %s", directory_path.AsUTF8Unsafe().c_str()); |
| 1094 change_list_loader_->LoadDirectoryFromServer( | 1095 change_list_loader_->LoadDirectoryFromServer( |
| 1095 id, base::Bind(&util::EmptyFileOperationCallback)); | 1096 id, base::Bind(&util::EmptyFileOperationCallback)); |
| 1096 } | 1097 } |
| 1097 | 1098 |
| 1098 } // namespace drive | 1099 } // namespace drive |
| OLD | NEW |