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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/extensions/file_browser_private_api.h" 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 system_service->cache()->GetCacheEntryOnUIThread( 1869 system_service->cache()->GetCacheEntryOnUIThread(
1870 file_proto->gdata_entry().resource_id(), 1870 file_proto->gdata_entry().resource_id(),
1871 file_proto->file_md5(), 1871 file_proto->file_md5(),
1872 base::Bind( 1872 base::Bind(
1873 &GetGDataFilePropertiesFunction::CacheStateReceived, 1873 &GetGDataFilePropertiesFunction::CacheStateReceived,
1874 this, property_dict)); 1874 this, property_dict));
1875 } 1875 }
1876 1876
1877 void GetGDataFilePropertiesFunction::CacheStateReceived( 1877 void GetGDataFilePropertiesFunction::CacheStateReceived(
1878 base::DictionaryValue* property_dict, 1878 base::DictionaryValue* property_dict,
1879 bool success, 1879 bool /* success */,
1880 const gdata::GDataCache::CacheEntry& cache_entry) { 1880 const gdata::GDataCache::CacheEntry& cache_entry) {
1881 const int cache_state = (success ? cache_entry.cache_state : 1881 // In case of an error (i.e. success is false), cache_entry.cache_state is
1882 gdata::GDataCache::CACHE_STATE_NONE); 1882 // set to CACHE_STATE_NONE.
1883 property_dict->SetBoolean( 1883 property_dict->SetBoolean("isPinned", cache_entry.IsPinned());
1884 "isPinned", 1884 property_dict->SetBoolean("isPresent", cache_entry.IsPresent());
1885 gdata::GDataCache::IsCachePinned(cache_state)); 1885 property_dict->SetBoolean("isDirty", cache_entry.IsDirty());
1886 1886
1887 property_dict->SetBoolean(
1888 "isPresent",
1889 gdata::GDataCache::IsCachePresent(cache_state));
1890
1891 property_dict->SetBoolean(
1892 "isDirty",
1893 gdata::GDataCache::IsCacheDirty(cache_state));
1894 CompleteGetFileProperties(); 1887 CompleteGetFileProperties();
1895 } 1888 }
1896 1889
1897 PinGDataFileFunction::PinGDataFileFunction() { 1890 PinGDataFileFunction::PinGDataFileFunction() {
1898 } 1891 }
1899 1892
1900 PinGDataFileFunction::~PinGDataFileFunction() { 1893 PinGDataFileFunction::~PinGDataFileFunction() {
1901 } 1894 }
1902 1895
1903 bool PinGDataFileFunction::RunImpl() { 1896 bool PinGDataFileFunction::RunImpl() {
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
2421 gdata::GDataSystemService* system_service = 2414 gdata::GDataSystemService* system_service =
2422 gdata::GDataSystemServiceFactory::GetForProfile(profile_); 2415 gdata::GDataSystemServiceFactory::GetForProfile(profile_);
2423 if (!system_service || !system_service->file_system()) 2416 if (!system_service || !system_service->file_system())
2424 return false; 2417 return false;
2425 2418
2426 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); 2419 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string));
2427 system_service->file_system()->RequestDirectoryRefresh(directory_path); 2420 system_service->file_system()->RequestDirectoryRefresh(directory_path);
2428 2421
2429 return true; 2422 return true;
2430 } 2423 }
OLDNEW
« 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