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.
5 #ifndef CHROME_BROWSER_DRIVE_DUMMY_DRIVE_SERVICE_H_
6 #define CHROME_BROWSER_DRIVE_DUMMY_DRIVE_SERVICE_H_
8 #include "chrome/browser/drive/drive_service_interface.h"
9 #include "google_apis/drive/auth_service_interface.h"
13 // Dummy implementation of DriveServiceInterface.
14 // All functions do nothing, or return place holder values like 'true'.
15 class DummyDriveService
: public DriveServiceInterface
{
18 virtual ~DummyDriveService();
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 AddNewDirectoryOptions
& options
,
107 const google_apis::GetResourceEntryCallback
& callback
) OVERRIDE
;
108 virtual google_apis::CancelCallback
InitiateUploadNewFile(
109 const std::string
& content_type
,
110 int64 content_length
,
111 const std::string
& parent_resource_id
,
112 const std::string
& title
,
113 const InitiateUploadNewFileOptions
& options
,
114 const google_apis::InitiateUploadCallback
& callback
) OVERRIDE
;
115 virtual google_apis::CancelCallback
InitiateUploadExistingFile(
116 const std::string
& content_type
,
117 int64 content_length
,
118 const std::string
& resource_id
,
119 const InitiateUploadExistingFileOptions
& options
,
120 const google_apis::InitiateUploadCallback
& callback
) OVERRIDE
;
121 virtual google_apis::CancelCallback
ResumeUpload(
122 const GURL
& upload_url
,
123 int64 start_position
,
125 int64 content_length
,
126 const std::string
& content_type
,
127 const base::FilePath
& local_file_path
,
128 const google_apis::UploadRangeCallback
& callback
,
129 const google_apis::ProgressCallback
& progress_callback
) OVERRIDE
;
130 virtual google_apis::CancelCallback
GetUploadStatus(
131 const GURL
& upload_url
,
132 int64 content_length
,
133 const google_apis::UploadRangeCallback
& callback
) OVERRIDE
;
134 virtual google_apis::CancelCallback
AuthorizeApp(
135 const std::string
& resource_id
,
136 const std::string
& app_id
,
137 const google_apis::AuthorizeAppCallback
& callback
) OVERRIDE
;
138 virtual google_apis::CancelCallback
UninstallApp(
139 const std::string
& app_id
,
140 const google_apis::EntryActionCallback
& callback
) OVERRIDE
;
141 virtual google_apis::CancelCallback
AddPermission(
142 const std::string
& resource_id
,
143 const std::string
& email
,
144 google_apis::drive::PermissionRole role
,
145 const google_apis::EntryActionCallback
& callback
) OVERRIDE
;
150 #endif // CHROME_BROWSER_DRIVE_DUMMY_DRIVE_SERVICE_H_