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

Unified Diff: chrome/browser/chromeos/extensions/file_browser_private_api.cc

Issue 10690126: gdata: Use member functions of CacheEntry where it can (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address commentx Created 8 years, 5 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 | « no previous file | chrome/browser/chromeos/gdata/gdata_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/file_browser_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/file_browser_private_api.cc b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
index 7cd02c2425b1b91eaad612da68449d7e6884f7a5..a34a36e0983f232860a1780f4da439d3afe62f40 100644
--- a/chrome/browser/chromeos/extensions/file_browser_private_api.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
@@ -1876,21 +1876,14 @@ void GetGDataFilePropertiesFunction::OnOperationComplete(
void GetGDataFilePropertiesFunction::CacheStateReceived(
base::DictionaryValue* property_dict,
- bool success,
+ bool /* success */,
const gdata::GDataCache::CacheEntry& cache_entry) {
- const int cache_state = (success ? cache_entry.cache_state :
- gdata::GDataCache::CACHE_STATE_NONE);
- property_dict->SetBoolean(
- "isPinned",
- gdata::GDataCache::IsCachePinned(cache_state));
-
- property_dict->SetBoolean(
- "isPresent",
- gdata::GDataCache::IsCachePresent(cache_state));
-
- property_dict->SetBoolean(
- "isDirty",
- gdata::GDataCache::IsCacheDirty(cache_state));
+ // In case of an error (i.e. success is false), cache_entry.cache_state is
+ // set to CACHE_STATE_NONE.
+ property_dict->SetBoolean("isPinned", cache_entry.IsPinned());
+ property_dict->SetBoolean("isPresent", cache_entry.IsPresent());
+ property_dict->SetBoolean("isDirty", cache_entry.IsDirty());
+
CompleteGetFileProperties();
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698