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

Side by Side 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: 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 unified diff | Download patch
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 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 entry->SetString("fileFullPath", "/" + results->at(i).path.value()); 2374 entry->SetString("fileFullPath", "/" + results->at(i).path.value());
2375 entry->SetBoolean("fileIsDirectory", results->at(i).is_directory); 2375 entry->SetBoolean("fileIsDirectory", results->at(i).is_directory);
2376 2376
2377 entries->Append(entry); 2377 entries->Append(entry);
2378 } 2378 }
2379 2379
2380 SetResult(entries); 2380 SetResult(entries);
2381 SendResponse(true); 2381 SendResponse(true);
2382 } 2382 }
2383 2383
2384 bool ClearDriveCacheFunction::RunImpl() {
2385 gdata::GDataSystemService* system_service =
2386 gdata::GDataSystemServiceFactory::GetForProfile(profile_);
2387 // |system_service| is NULL if incognito window / guest login.
2388 if (!system_service || !system_service->file_system())
2389 return false;
2390
2391 // TODO(yoshiki): Receive a callback from JS-side and pass it to ClearCache().
satorux1 2012/08/03 17:54:21 Please file a bug that describes the plan and add
yoshiki 2012/08/03 20:09:48 Done.
2392 system_service->ClearCache(base::Callback<void(bool)>());
2393
2394 SendResponse(true);
2395 return true;
2396 }
2397
2384 bool GetNetworkConnectionStateFunction::RunImpl() { 2398 bool GetNetworkConnectionStateFunction::RunImpl() {
2385 chromeos::NetworkLibrary* network_library = 2399 chromeos::NetworkLibrary* network_library =
2386 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); 2400 chromeos::CrosLibrary::Get()->GetNetworkLibrary();
2387 if (!network_library) 2401 if (!network_library)
2388 return false; 2402 return false;
2389 2403
2390 const chromeos::Network* active_network = network_library->active_network(); 2404 const chromeos::Network* active_network = network_library->active_network();
2391 2405
2392 scoped_ptr<DictionaryValue> value(new DictionaryValue()); 2406 scoped_ptr<DictionaryValue> value(new DictionaryValue());
2393 value->SetBoolean("online", active_network && active_network->online()); 2407 value->SetBoolean("online", active_network && active_network->online());
(...skipping 20 matching lines...) Expand all
2414 gdata::GDataSystemService* system_service = 2428 gdata::GDataSystemService* system_service =
2415 gdata::GDataSystemServiceFactory::GetForProfile(profile_); 2429 gdata::GDataSystemServiceFactory::GetForProfile(profile_);
2416 if (!system_service || !system_service->file_system()) 2430 if (!system_service || !system_service->file_system())
2417 return false; 2431 return false;
2418 2432
2419 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); 2433 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string));
2420 system_service->file_system()->RequestDirectoryRefresh(directory_path); 2434 system_service->file_system()->RequestDirectoryRefresh(directory_path);
2421 2435
2422 return true; 2436 return true;
2423 } 2437 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698