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

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

Issue 10837091: Drive: Adds clearDriveCache API to file_browser_private. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 4 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
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 e02d109d02b9bc0dc49cab5c3e6bc61e10c3f60d..f51d426609c8420c78bbe3e7763e82c751f739c3 100644
--- a/chrome/browser/chromeos/extensions/file_browser_private_api.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
@@ -2365,6 +2365,21 @@ void SearchDriveFunction::OnSearch(
SendResponse(true);
}
+bool ClearDriveCacheFunction::RunImpl() {
+ gdata::GDataSystemService* system_service =
+ gdata::GDataSystemServiceFactory::GetForProfile(profile_);
+ // |system_service| is NULL if incognito window / guest login.
+ if (!system_service || !system_service->file_system())
+ return false;
+
+ // TODO(yoshiki): Receive a callback from JS-side and pass it to
+ // ClearCacheAndRemountFileSystem(). http://crbug.com/140511
+ system_service->ClearCacheAndRemountFileSystem(base::Callback<void(bool)>());
+
+ SendResponse(true);
+ return true;
+}
+
bool GetNetworkConnectionStateFunction::RunImpl() {
chromeos::NetworkLibrary* network_library =
chromeos::CrosLibrary::Get()->GetNetworkLibrary();

Powered by Google App Engine
This is Rietveld 408576698