OLD | NEW |
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 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2358 entry->SetString("fileFullPath", "/" + results->at(i).path.value()); | 2358 entry->SetString("fileFullPath", "/" + results->at(i).path.value()); |
2359 entry->SetBoolean("fileIsDirectory", results->at(i).is_directory); | 2359 entry->SetBoolean("fileIsDirectory", results->at(i).is_directory); |
2360 | 2360 |
2361 entries->Append(entry); | 2361 entries->Append(entry); |
2362 } | 2362 } |
2363 | 2363 |
2364 SetResult(entries); | 2364 SetResult(entries); |
2365 SendResponse(true); | 2365 SendResponse(true); |
2366 } | 2366 } |
2367 | 2367 |
| 2368 bool ClearDriveCacheFunction::RunImpl() { |
| 2369 gdata::GDataSystemService* system_service = |
| 2370 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
| 2371 // |system_service| is NULL if incognito window / guest login. |
| 2372 if (!system_service || !system_service->file_system()) |
| 2373 return false; |
| 2374 |
| 2375 // TODO(yoshiki): Receive a callback from JS-side and pass it to |
| 2376 // ClearCacheAndRemountFileSystem(). http://crbug.com/140511 |
| 2377 system_service->ClearCacheAndRemountFileSystem(base::Callback<void(bool)>()); |
| 2378 |
| 2379 SendResponse(true); |
| 2380 return true; |
| 2381 } |
| 2382 |
2368 bool GetNetworkConnectionStateFunction::RunImpl() { | 2383 bool GetNetworkConnectionStateFunction::RunImpl() { |
2369 chromeos::NetworkLibrary* network_library = | 2384 chromeos::NetworkLibrary* network_library = |
2370 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); | 2385 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); |
2371 if (!network_library) | 2386 if (!network_library) |
2372 return false; | 2387 return false; |
2373 | 2388 |
2374 const chromeos::Network* active_network = network_library->active_network(); | 2389 const chromeos::Network* active_network = network_library->active_network(); |
2375 | 2390 |
2376 scoped_ptr<DictionaryValue> value(new DictionaryValue()); | 2391 scoped_ptr<DictionaryValue> value(new DictionaryValue()); |
2377 value->SetBoolean("online", active_network && active_network->online()); | 2392 value->SetBoolean("online", active_network && active_network->online()); |
(...skipping 20 matching lines...) Expand all Loading... |
2398 gdata::GDataSystemService* system_service = | 2413 gdata::GDataSystemService* system_service = |
2399 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 2414 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
2400 if (!system_service || !system_service->file_system()) | 2415 if (!system_service || !system_service->file_system()) |
2401 return false; | 2416 return false; |
2402 | 2417 |
2403 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); | 2418 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); |
2404 system_service->file_system()->RequestDirectoryRefresh(directory_path); | 2419 system_service->file_system()->RequestDirectoryRefresh(directory_path); |
2405 | 2420 |
2406 return true; | 2421 return true; |
2407 } | 2422 } |
OLD | NEW |