17d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
27d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
37d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// found in the LICENSE file.
47d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
57d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "chrome/browser/drive/dummy_drive_service.h"
67d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
7d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "base/bind.h"
8d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
9424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)using google_apis::AboutResourceCallback;
10424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)using google_apis::AppListCallback;
117dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochusing google_apis::AuthStatusCallback;
12eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochusing google_apis::AuthorizeAppCallback;
13eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochusing google_apis::CancelCallback;
14cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)using google_apis::ChangeListCallback;
15eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochusing google_apis::DownloadActionCallback;
16eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochusing google_apis::EntryActionCallback;
1746d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)using google_apis::FileListCallback;
1846d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)using google_apis::FileResourceCallback;
19eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochusing google_apis::GetContentCallback;
20bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdochusing google_apis::GetShareUrlCallback;
21eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochusing google_apis::InitiateUploadCallback;
22eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochusing google_apis::ProgressCallback;
2346d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)using google_apis::drive::UploadRangeCallback;
24eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
25eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochnamespace drive {
267d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
277d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)DummyDriveService::DummyDriveService() {}
287d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
297d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)DummyDriveService::~DummyDriveService() {}
307d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
3168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)void DummyDriveService::Initialize(const std::string& account_id) {}
327d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
337d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)void DummyDriveService::AddObserver(DriveServiceObserver* observer) {}
347d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
357d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)void DummyDriveService::RemoveObserver(DriveServiceObserver* observer) {}
367d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
377d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)bool DummyDriveService::CanSendRequest() const { return true; }
387d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
397d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)bool DummyDriveService::HasAccessToken() const { return true; }
407d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
417dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochvoid DummyDriveService::RequestAccessToken(const AuthStatusCallback& callback) {
427dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  callback.Run(google_apis::HTTP_NOT_MODIFIED, "fake_access_token");
437dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch}
447dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
457d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)bool DummyDriveService::HasRefreshToken() const { return true; }
467d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
477d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)void DummyDriveService::ClearAccessToken() { }
487d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
497d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)void DummyDriveService::ClearRefreshToken() { }
507d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
517d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)std::string DummyDriveService::GetRootResourceId() const {
527d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  return "dummy_root";
537d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)}
547d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
5546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)CancelCallback DummyDriveService::GetAllFileList(
5646d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)    const FileListCallback& callback) { return CancelCallback(); }
577d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
5846d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)CancelCallback DummyDriveService::GetFileListInDirectory(
597d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& directory_resource_id,
6046d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)    const FileListCallback& callback) { return CancelCallback(); }
617d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
627d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::Search(
637d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& search_query,
6446d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)    const FileListCallback& callback) { return CancelCallback(); }
657d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
667d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::SearchByTitle(
677d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& title,
687d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& directory_resource_id,
6946d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)    const FileListCallback& callback) { return CancelCallback(); }
707d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
717d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::GetChangeList(
727d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    int64 start_changestamp,
73cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)    const ChangeListCallback& callback) { return CancelCallback(); }
747d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
75424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)CancelCallback DummyDriveService::GetRemainingChangeList(
7658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)    const GURL& next_link,
77cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)    const ChangeListCallback& callback) { return CancelCallback(); }
78424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
79424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)CancelCallback DummyDriveService::GetRemainingFileList(
8058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)    const GURL& next_link,
8146d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)    const FileListCallback& callback) { return CancelCallback(); }
82424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
8346d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)CancelCallback DummyDriveService::GetFileResource(
847d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& resource_id,
8546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)    const FileResourceCallback& callback) { return CancelCallback(); }
867d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
87bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben MurdochCancelCallback DummyDriveService::GetShareUrl(
88bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch    const std::string& resource_id,
89bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch    const GURL& embed_origin,
90bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch    const GetShareUrlCallback& callback) { return CancelCallback(); }
91bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch
927d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::GetAboutResource(
93424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)    const AboutResourceCallback& callback) { return CancelCallback(); }
947d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
957d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::GetAppList(
96424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)    const AppListCallback& callback) { return CancelCallback(); }
977d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
987d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::DeleteResource(
997d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& resource_id,
1007d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& etag,
1017d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const EntryActionCallback& callback) { return CancelCallback(); }
1027d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
1035d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)CancelCallback DummyDriveService::TrashResource(
1045d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    const std::string& resource_id,
1055d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    const EntryActionCallback& callback) { return CancelCallback(); }
1065d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1077d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::DownloadFile(
1087d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const base::FilePath& local_cache_path,
109eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch    const std::string& resource_id,
1107d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const DownloadActionCallback& download_action_callback,
1117d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const GetContentCallback& get_content_callback,
1127d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const ProgressCallback& progress_callback) { return CancelCallback(); }
1137d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
1147d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::CopyResource(
1157d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& resource_id,
1167d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& parent_resource_id,
1177dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch    const std::string& new_title,
11868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)    const base::Time& last_modified,
11946d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)    const FileResourceCallback& callback) { return CancelCallback(); }
1207d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
121f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)CancelCallback DummyDriveService::UpdateResource(
1223551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)    const std::string& resource_id,
1233551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)    const std::string& parent_resource_id,
1243551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)    const std::string& new_title,
12568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)    const base::Time& last_modified,
126f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)    const base::Time& last_viewed_by_me,
12746d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)    const google_apis::FileResourceCallback& callback) {
1283551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)  return CancelCallback();
1293551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)}
1303551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
1317d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::AddResourceToDirectory(
1327d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& parent_resource_id,
1337d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& resource_id,
1347d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const EntryActionCallback& callback) { return CancelCallback(); }
1357d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
1367d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::RemoveResourceFromDirectory(
1377d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& parent_resource_id,
1387d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& resource_id,
1397d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const EntryActionCallback& callback) { return CancelCallback(); }
1407d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
1417d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::AddNewDirectory(
1427d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& parent_resource_id,
1437dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch    const std::string& directory_title,
1445d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    const AddNewDirectoryOptions& options,
14546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)    const FileResourceCallback& callback) { return CancelCallback(); }
1467d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
1477d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::InitiateUploadNewFile(
1487d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& content_type,
1497d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    int64 content_length,
1507d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& parent_resource_id,
1517d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& title,
1525d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    const InitiateUploadNewFileOptions& options,
1537d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const InitiateUploadCallback& callback) { return CancelCallback(); }
1547d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
1557d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::InitiateUploadExistingFile(
1567d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& content_type,
1577d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    int64 content_length,
1587d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& resource_id,
1595d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    const InitiateUploadExistingFileOptions& options,
1607d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const InitiateUploadCallback& callback) { return CancelCallback(); }
1617d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
1627d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::ResumeUpload(
1637d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const GURL& upload_url,
1647d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    int64 start_position,
1657d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    int64 end_position,
1667d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    int64 content_length,
1677d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& content_type,
1687d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const base::FilePath& local_file_path,
1697d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const UploadRangeCallback& callback,
1707d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const ProgressCallback& progress_callback) { return CancelCallback(); }
1717d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
1727d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::GetUploadStatus(
1737d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const GURL& upload_url,
1747d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    int64 content_length,
1757d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const UploadRangeCallback& callback) { return CancelCallback(); }
1767d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
1777d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)CancelCallback DummyDriveService::AuthorizeApp(
1787d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& resource_id,
1797d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const std::string& app_id,
1807d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const AuthorizeAppCallback& callback) { return CancelCallback(); }
1817d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
1825d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)CancelCallback DummyDriveService::UninstallApp(
1835d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    const std::string& app_id,
1845d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    const EntryActionCallback& callback) { return CancelCallback(); }
1855d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
186a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)CancelCallback DummyDriveService::AddPermission(
187a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    const std::string& resource_id,
188a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    const std::string& email,
189a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    google_apis::drive::PermissionRole role,
190a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    const EntryActionCallback& callback) { return CancelCallback(); }
191a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
192eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch}  // namespace drive
193