Home | History | Annotate | Download | only in drive
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_DRIVE_DUMMY_DRIVE_SERVICE_H_
      6 #define CHROME_BROWSER_DRIVE_DUMMY_DRIVE_SERVICE_H_
      7 
      8 #include "chrome/browser/drive/drive_service_interface.h"
      9 #include "google_apis/drive/auth_service_interface.h"
     10 
     11 namespace drive {
     12 
     13 // Dummy implementation of DriveServiceInterface.
     14 // All functions do nothing, or return place holder values like 'true'.
     15 class DummyDriveService : public DriveServiceInterface {
     16  public:
     17   DummyDriveService();
     18   virtual ~DummyDriveService();
     19 
     20   // DriveServiceInterface Overrides
     21   virtual void Initialize(const std::string& account_id) OVERRIDE;
     22   virtual void AddObserver(DriveServiceObserver* observer) OVERRIDE;
     23   virtual void RemoveObserver(DriveServiceObserver* observer) OVERRIDE;
     24   virtual bool CanSendRequest() const OVERRIDE;
     25   virtual ResourceIdCanonicalizer GetResourceIdCanonicalizer() const OVERRIDE;
     26   virtual bool HasAccessToken() const OVERRIDE;
     27   virtual void RequestAccessToken(
     28       const google_apis::AuthStatusCallback& callback) OVERRIDE;
     29   virtual bool HasRefreshToken() const OVERRIDE;
     30   virtual void ClearAccessToken() OVERRIDE;
     31   virtual void ClearRefreshToken() OVERRIDE;
     32   virtual std::string GetRootResourceId() const OVERRIDE;
     33   virtual google_apis::CancelCallback GetAllResourceList(
     34       const google_apis::GetResourceListCallback& callback) OVERRIDE;
     35   virtual google_apis::CancelCallback GetResourceListInDirectory(
     36       const std::string& directory_resource_id,
     37       const google_apis::GetResourceListCallback& callback) OVERRIDE;
     38   virtual google_apis::CancelCallback Search(
     39       const std::string& search_query,
     40       const google_apis::GetResourceListCallback& callback) OVERRIDE;
     41   virtual google_apis::CancelCallback SearchByTitle(
     42       const std::string& title,
     43       const std::string& directory_resource_id,
     44       const google_apis::GetResourceListCallback& callback) OVERRIDE;
     45   virtual google_apis::CancelCallback GetChangeList(
     46       int64 start_changestamp,
     47       const google_apis::GetResourceListCallback& callback) OVERRIDE;
     48   virtual google_apis::CancelCallback GetRemainingChangeList(
     49       const GURL& next_link,
     50       const google_apis::GetResourceListCallback& callback) OVERRIDE;
     51   virtual google_apis::CancelCallback GetRemainingFileList(
     52       const GURL& next_link,
     53       const google_apis::GetResourceListCallback& callback) OVERRIDE;
     54   virtual google_apis::CancelCallback GetResourceEntry(
     55       const std::string& resource_id,
     56       const google_apis::GetResourceEntryCallback& callback) OVERRIDE;
     57   virtual google_apis::CancelCallback GetShareUrl(
     58       const std::string& resource_id,
     59       const GURL& embed_origin,
     60       const google_apis::GetShareUrlCallback& callback) OVERRIDE;
     61   virtual google_apis::CancelCallback GetAboutResource(
     62       const google_apis::AboutResourceCallback& callback) OVERRIDE;
     63   virtual google_apis::CancelCallback GetAppList(
     64       const google_apis::AppListCallback& callback) OVERRIDE;
     65   virtual google_apis::CancelCallback DeleteResource(
     66       const std::string& resource_id,
     67       const std::string& etag,
     68       const google_apis::EntryActionCallback& callback) OVERRIDE;
     69   virtual google_apis::CancelCallback TrashResource(
     70       const std::string& resource_id,
     71       const google_apis::EntryActionCallback& callback) OVERRIDE;
     72   virtual google_apis::CancelCallback DownloadFile(
     73       const base::FilePath& local_cache_path,
     74       const std::string& resource_id,
     75       const google_apis::DownloadActionCallback& download_action_callback,
     76       const google_apis::GetContentCallback& get_content_callback,
     77       const google_apis::ProgressCallback& progress_callback) OVERRIDE;
     78   virtual google_apis::CancelCallback CopyResource(
     79       const std::string& resource_id,
     80       const std::string& parent_resource_id,
     81       const std::string& new_title,
     82       const base::Time& last_modified,
     83       const google_apis::GetResourceEntryCallback& callback) OVERRIDE;
     84   virtual google_apis::CancelCallback UpdateResource(
     85       const std::string& resource_id,
     86       const std::string& parent_resource_id,
     87       const std::string& new_title,
     88       const base::Time& last_modified,
     89       const base::Time& last_viewed_by_me,
     90       const google_apis::GetResourceEntryCallback& callback) OVERRIDE;
     91   virtual google_apis::CancelCallback RenameResource(
     92       const std::string& resource_id,
     93       const std::string& new_title,
     94       const google_apis::EntryActionCallback& callback) OVERRIDE;
     95   virtual google_apis::CancelCallback AddResourceToDirectory(
     96       const std::string& parent_resource_id,
     97       const std::string& resource_id,
     98       const google_apis::EntryActionCallback& callback) OVERRIDE;
     99   virtual google_apis::CancelCallback RemoveResourceFromDirectory(
    100       const std::string& parent_resource_id,
    101       const std::string& resource_id,
    102       const google_apis::EntryActionCallback& callback) OVERRIDE;
    103   virtual google_apis::CancelCallback AddNewDirectory(
    104       const std::string& parent_resource_id,
    105       const std::string& directory_title,
    106       const google_apis::GetResourceEntryCallback& callback) OVERRIDE;
    107   virtual google_apis::CancelCallback InitiateUploadNewFile(
    108       const std::string& content_type,
    109       int64 content_length,
    110       const std::string& parent_resource_id,
    111       const std::string& title,
    112       const google_apis::InitiateUploadCallback& callback) OVERRIDE;
    113   virtual google_apis::CancelCallback InitiateUploadExistingFile(
    114       const std::string& content_type,
    115       int64 content_length,
    116       const std::string& resource_id,
    117       const std::string& etag,
    118       const google_apis::InitiateUploadCallback& callback) OVERRIDE;
    119   virtual google_apis::CancelCallback ResumeUpload(
    120       const GURL& upload_url,
    121       int64 start_position,
    122       int64 end_position,
    123       int64 content_length,
    124       const std::string& content_type,
    125       const base::FilePath& local_file_path,
    126       const google_apis::UploadRangeCallback& callback,
    127       const google_apis::ProgressCallback& progress_callback) OVERRIDE;
    128   virtual google_apis::CancelCallback GetUploadStatus(
    129       const GURL& upload_url,
    130       int64 content_length,
    131       const google_apis::UploadRangeCallback& callback) OVERRIDE;
    132   virtual google_apis::CancelCallback AuthorizeApp(
    133       const std::string& resource_id,
    134       const std::string& app_id,
    135       const google_apis::AuthorizeAppCallback& callback) OVERRIDE;
    136   virtual google_apis::CancelCallback GetResourceListInDirectoryByWapi(
    137       const std::string& directory_resource_id,
    138       const google_apis::GetResourceListCallback& callback) OVERRIDE;
    139   virtual google_apis::CancelCallback GetRemainingResourceList(
    140       const GURL& next_link,
    141       const google_apis::GetResourceListCallback& callback) OVERRIDE;
    142 };
    143 
    144 }  // namespace drive
    145 
    146 #endif  // CHROME_BROWSER_DRIVE_DUMMY_DRIVE_SERVICE_H_
    147