Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc

Issue 276313002: drive: Change FileCache::GetCacheEntry's return type to FileError (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/drive/sync_client_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
index 52dd4eb9a80085cfb6bc1ea77927904d99322a1a..6b970239ecac9157da3f20ca13456ba486cdf633 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
@@ -319,16 +319,20 @@ class SingleDriveEntryPropertiesGetter {
GetWeakPtr()));
}
- void CacheStateReceived(bool /* success */,
+ void CacheStateReceived(drive::FileError error,
const drive::FileCacheEntry& cache_entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- // In case of an error (i.e. success is false), cache_entry.is_*() all
- // returns false.
- properties_->is_pinned.reset(new bool(cache_entry.is_pinned()));
- properties_->is_present.reset(new bool(cache_entry.is_present()));
-
- CompleteGetFileProperties(drive::FILE_ERROR_OK);
+ if (error == drive::FILE_ERROR_OK) {
+ properties_->is_pinned.reset(new bool(cache_entry.is_pinned()));
+ properties_->is_present.reset(new bool(cache_entry.is_present()));
+ } else if (error == drive::FILE_ERROR_NOT_FOUND) {
+ // NOT_FOUND is not an error, return OK instead.
+ error = drive::FILE_ERROR_OK;
+ properties_->is_pinned.reset(new bool(false));
+ properties_->is_present.reset(new bool(false));
+ }
+ CompleteGetFileProperties(error);
}
void CompleteGetFileProperties(drive::FileError error) {
« no previous file with comments | « chrome/browser/chromeos/drive/sync_client_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698