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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 | 10 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 const GetFileInfoCallback& callback) = 0; | 358 const GetFileInfoCallback& callback) = 0; |
359 | 359 |
360 // Finds and reads a directory by |file_path|. This call will also retrieve | 360 // Finds and reads a directory by |file_path|. This call will also retrieve |
361 // and refresh file system content from server and disk cache. | 361 // and refresh file system content from server and disk cache. |
362 // | 362 // |
363 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 363 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
364 virtual void ReadDirectoryByPathAsync( | 364 virtual void ReadDirectoryByPathAsync( |
365 const FilePath& file_path, | 365 const FilePath& file_path, |
366 const ReadDirectoryCallback& callback) = 0; | 366 const ReadDirectoryCallback& callback) = 0; |
367 | 367 |
| 368 // Requests a refresh of the directory pointed by |file_path| (i.e. fetches |
| 369 // the latest metadata of files in the target directory). |
| 370 // |
| 371 // In particular, this function is used to get the latest thumbnail |
| 372 // URLs. Thumbnail URLs change periodically even if contents of files are |
| 373 // not changed, hence we should get the new thumbnail URLs manually if we |
| 374 // detect that the existing thumnail URLs are stale. |
| 375 // |
| 376 // Upon success, the metadata of files in the target directory is updated, |
| 377 // and the change is notified via Observer::OnDirectoryChanged(). Note that |
| 378 // this function ignores changes in directories in the target |
| 379 // directory. Changes in directories are handled via the delta feeds. |
| 380 // |
| 381 // Can be called from UI/IO thread. |
| 382 virtual void RequestDirectoryRefresh(const FilePath& file_path) = 0; |
| 383 |
368 // Does server side content search for |search_query|. Search results will be | 384 // Does server side content search for |search_query|. Search results will be |
369 // returned as gdata entries in temp directory proto, and their | 385 // returned as gdata entries in temp directory proto, and their |
370 // title/file_name will be formatted as |<resource_id>.<original_file_name>|. | 386 // title/file_name will be formatted as |<resource_id>.<original_file_name>|. |
371 // | 387 // |
372 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 388 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
373 virtual void SearchAsync(const std::string& search_query, | 389 virtual void SearchAsync(const std::string& search_query, |
374 const ReadDirectoryCallback& callback) = 0; | 390 const ReadDirectoryCallback& callback) = 0; |
375 | 391 |
376 | 392 |
377 // Finds a file (not a directory) by |file_path| and returns its key | 393 // Finds a file (not a directory) by |file_path| and returns its key |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 const GetCacheStateCallback& callback) OVERRIDE; | 493 const GetCacheStateCallback& callback) OVERRIDE; |
478 virtual void GetEntryInfoByPathAsync( | 494 virtual void GetEntryInfoByPathAsync( |
479 const FilePath& file_path, | 495 const FilePath& file_path, |
480 const GetEntryInfoCallback& callback) OVERRIDE; | 496 const GetEntryInfoCallback& callback) OVERRIDE; |
481 virtual void GetFileInfoByPathAsync( | 497 virtual void GetFileInfoByPathAsync( |
482 const FilePath& file_path, | 498 const FilePath& file_path, |
483 const GetFileInfoCallback& callback) OVERRIDE; | 499 const GetFileInfoCallback& callback) OVERRIDE; |
484 virtual void ReadDirectoryByPathAsync( | 500 virtual void ReadDirectoryByPathAsync( |
485 const FilePath& file_path, | 501 const FilePath& file_path, |
486 const ReadDirectoryCallback& callback) OVERRIDE; | 502 const ReadDirectoryCallback& callback) OVERRIDE; |
| 503 virtual void RequestDirectoryRefresh( |
| 504 const FilePath& file_path) OVERRIDE; |
487 virtual bool GetFileInfoByPath(const FilePath& file_path, | 505 virtual bool GetFileInfoByPath(const FilePath& file_path, |
488 GDataFileProperties* properties) OVERRIDE; | 506 GDataFileProperties* properties) OVERRIDE; |
489 virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const OVERRIDE; | 507 virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const OVERRIDE; |
490 virtual FilePath GetCacheDirectoryPath( | 508 virtual FilePath GetCacheDirectoryPath( |
491 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const OVERRIDE; | 509 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const OVERRIDE; |
492 virtual FilePath GetCacheFilePath( | 510 virtual FilePath GetCacheFilePath( |
493 const std::string& resource_id, | 511 const std::string& resource_id, |
494 const std::string& md5, | 512 const std::string& md5, |
495 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, | 513 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, |
496 CachedFileOrigin file_orign) const OVERRIDE; | 514 CachedFileOrigin file_orign) const OVERRIDE; |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 const GetDownloadDataCallback& get_download_data_callback); | 1413 const GetDownloadDataCallback& get_download_data_callback); |
1396 void GetEntryInfoByPathAsyncOnUIThread( | 1414 void GetEntryInfoByPathAsyncOnUIThread( |
1397 const FilePath& file_path, | 1415 const FilePath& file_path, |
1398 const GetEntryInfoCallback& callback); | 1416 const GetEntryInfoCallback& callback); |
1399 void GetFileInfoByPathAsyncOnUIThread( | 1417 void GetFileInfoByPathAsyncOnUIThread( |
1400 const FilePath& file_path, | 1418 const FilePath& file_path, |
1401 const GetFileInfoCallback& callback); | 1419 const GetFileInfoCallback& callback); |
1402 void ReadDirectoryByPathAsyncOnUIThread( | 1420 void ReadDirectoryByPathAsyncOnUIThread( |
1403 const FilePath& file_path, | 1421 const FilePath& file_path, |
1404 const ReadDirectoryCallback& callback); | 1422 const ReadDirectoryCallback& callback); |
| 1423 void RequestDirectoryRefreshOnUIThread( |
| 1424 const FilePath& file_path); |
| 1425 void OnRequestDirectoryRefresh(GetDocumentsParams* params, |
| 1426 base::PlatformFileError error); |
1405 void GetCacheStateOnUIThread(const std::string& resource_id, | 1427 void GetCacheStateOnUIThread(const std::string& resource_id, |
1406 const std::string& md5, | 1428 const std::string& md5, |
1407 const GetCacheStateCallback& callback); | 1429 const GetCacheStateCallback& callback); |
1408 void GetAvailableSpaceOnUIThread(const GetAvailableSpaceCallback& callback); | 1430 void GetAvailableSpaceOnUIThread(const GetAvailableSpaceCallback& callback); |
1409 void SetPinStateOnUIThread(const FilePath& file_path, bool to_pin, | 1431 void SetPinStateOnUIThread(const FilePath& file_path, bool to_pin, |
1410 const FileOperationCallback& callback); | 1432 const FileOperationCallback& callback); |
1411 void SetMountedStateOnUIThread( | 1433 void SetMountedStateOnUIThread( |
1412 const FilePath& file_path, | 1434 const FilePath& file_path, |
1413 bool to_mount, | 1435 bool to_mount, |
1414 const SetMountedStateCallback& callback); | 1436 const SetMountedStateCallback& callback); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 }; | 1499 }; |
1478 | 1500 |
1479 // Sets the free disk space getter for testing. | 1501 // Sets the free disk space getter for testing. |
1480 // The existing getter is deleted. | 1502 // The existing getter is deleted. |
1481 void SetFreeDiskSpaceGetterForTesting( | 1503 void SetFreeDiskSpaceGetterForTesting( |
1482 FreeDiskSpaceGetterInterface* getter); | 1504 FreeDiskSpaceGetterInterface* getter); |
1483 | 1505 |
1484 } // namespace gdata | 1506 } // namespace gdata |
1485 | 1507 |
1486 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1508 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |