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 | |
384 // Does server side content search for |search_query|. Search results will be | 368 // Does server side content search for |search_query|. Search results will be |
385 // returned as gdata entries in temp directory proto, and their | 369 // returned as gdata entries in temp directory proto, and their |
386 // title/file_name will be formatted as |<resource_id>.<original_file_name>|. | 370 // title/file_name will be formatted as |<resource_id>.<original_file_name>|. |
387 // | 371 // |
388 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 372 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
389 virtual void SearchAsync(const std::string& search_query, | 373 virtual void SearchAsync(const std::string& search_query, |
390 const ReadDirectoryCallback& callback) = 0; | 374 const ReadDirectoryCallback& callback) = 0; |
391 | 375 |
392 | 376 |
393 // Finds a file (not a directory) by |file_path| and returns its key | 377 // 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... |
493 const GetCacheStateCallback& callback) OVERRIDE; | 477 const GetCacheStateCallback& callback) OVERRIDE; |
494 virtual void GetEntryInfoByPathAsync( | 478 virtual void GetEntryInfoByPathAsync( |
495 const FilePath& file_path, | 479 const FilePath& file_path, |
496 const GetEntryInfoCallback& callback) OVERRIDE; | 480 const GetEntryInfoCallback& callback) OVERRIDE; |
497 virtual void GetFileInfoByPathAsync( | 481 virtual void GetFileInfoByPathAsync( |
498 const FilePath& file_path, | 482 const FilePath& file_path, |
499 const GetFileInfoCallback& callback) OVERRIDE; | 483 const GetFileInfoCallback& callback) OVERRIDE; |
500 virtual void ReadDirectoryByPathAsync( | 484 virtual void ReadDirectoryByPathAsync( |
501 const FilePath& file_path, | 485 const FilePath& file_path, |
502 const ReadDirectoryCallback& callback) OVERRIDE; | 486 const ReadDirectoryCallback& callback) OVERRIDE; |
503 virtual void RequestDirectoryRefresh( | |
504 const FilePath& file_path) OVERRIDE; | |
505 virtual bool GetFileInfoByPath(const FilePath& file_path, | 487 virtual bool GetFileInfoByPath(const FilePath& file_path, |
506 GDataFileProperties* properties) OVERRIDE; | 488 GDataFileProperties* properties) OVERRIDE; |
507 virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const OVERRIDE; | 489 virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const OVERRIDE; |
508 virtual FilePath GetCacheDirectoryPath( | 490 virtual FilePath GetCacheDirectoryPath( |
509 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const OVERRIDE; | 491 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const OVERRIDE; |
510 virtual FilePath GetCacheFilePath( | 492 virtual FilePath GetCacheFilePath( |
511 const std::string& resource_id, | 493 const std::string& resource_id, |
512 const std::string& md5, | 494 const std::string& md5, |
513 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, | 495 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, |
514 CachedFileOrigin file_orign) const OVERRIDE; | 496 CachedFileOrigin file_orign) const OVERRIDE; |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 const GetDownloadDataCallback& get_download_data_callback); | 1395 const GetDownloadDataCallback& get_download_data_callback); |
1414 void GetEntryInfoByPathAsyncOnUIThread( | 1396 void GetEntryInfoByPathAsyncOnUIThread( |
1415 const FilePath& file_path, | 1397 const FilePath& file_path, |
1416 const GetEntryInfoCallback& callback); | 1398 const GetEntryInfoCallback& callback); |
1417 void GetFileInfoByPathAsyncOnUIThread( | 1399 void GetFileInfoByPathAsyncOnUIThread( |
1418 const FilePath& file_path, | 1400 const FilePath& file_path, |
1419 const GetFileInfoCallback& callback); | 1401 const GetFileInfoCallback& callback); |
1420 void ReadDirectoryByPathAsyncOnUIThread( | 1402 void ReadDirectoryByPathAsyncOnUIThread( |
1421 const FilePath& file_path, | 1403 const FilePath& file_path, |
1422 const ReadDirectoryCallback& callback); | 1404 const ReadDirectoryCallback& callback); |
1423 void RequestDirectoryRefreshOnUIThread( | |
1424 const FilePath& file_path); | |
1425 void OnRequestDirectoryRefresh(GetDocumentsParams* params, | |
1426 base::PlatformFileError error); | |
1427 void GetCacheStateOnUIThread(const std::string& resource_id, | 1405 void GetCacheStateOnUIThread(const std::string& resource_id, |
1428 const std::string& md5, | 1406 const std::string& md5, |
1429 const GetCacheStateCallback& callback); | 1407 const GetCacheStateCallback& callback); |
1430 void GetAvailableSpaceOnUIThread(const GetAvailableSpaceCallback& callback); | 1408 void GetAvailableSpaceOnUIThread(const GetAvailableSpaceCallback& callback); |
1431 void SetPinStateOnUIThread(const FilePath& file_path, bool to_pin, | 1409 void SetPinStateOnUIThread(const FilePath& file_path, bool to_pin, |
1432 const FileOperationCallback& callback); | 1410 const FileOperationCallback& callback); |
1433 void SetMountedStateOnUIThread( | 1411 void SetMountedStateOnUIThread( |
1434 const FilePath& file_path, | 1412 const FilePath& file_path, |
1435 bool to_mount, | 1413 bool to_mount, |
1436 const SetMountedStateCallback& callback); | 1414 const SetMountedStateCallback& callback); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 }; | 1477 }; |
1500 | 1478 |
1501 // Sets the free disk space getter for testing. | 1479 // Sets the free disk space getter for testing. |
1502 // The existing getter is deleted. | 1480 // The existing getter is deleted. |
1503 void SetFreeDiskSpaceGetterForTesting( | 1481 void SetFreeDiskSpaceGetterForTesting( |
1504 FreeDiskSpaceGetterInterface* getter); | 1482 FreeDiskSpaceGetterInterface* getter); |
1505 | 1483 |
1506 } // namespace gdata | 1484 } // namespace gdata |
1507 | 1485 |
1508 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1486 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |