1 // Copyright 2014 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_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_SERVICE_WRAPPER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_SERVICE_WRAPPER_H_
8 #include "base/memory/weak_ptr.h"
9 #include "chrome/browser/drive/drive_service_interface.h"
11 namespace sync_file_system {
12 namespace drive_backend {
14 // This class wraps a part of DriveServiceInterface class to support weak
15 // pointer. Each method wraps corresponding name method of
16 // DriveServiceInterface. See comments in drive_service_interface.h
18 class DriveServiceWrapper : public base::SupportsWeakPtr<DriveServiceWrapper> {
20 explicit DriveServiceWrapper(drive::DriveServiceInterface* drive_service);
23 const std::string& parent_resource_id,
24 const std::string& directory_title,
25 const drive::DriveServiceInterface::AddNewDirectoryOptions& options,
26 const google_apis::GetResourceEntryCallback& callback);
29 const std::string& resource_id,
30 const std::string& etag,
31 const google_apis::EntryActionCallback& callback);
34 const base::FilePath& local_cache_path,
35 const std::string& resource_id,
36 const google_apis::DownloadActionCallback& download_action_callback,
37 const google_apis::GetContentCallback& get_content_callback,
38 const google_apis::ProgressCallback& progress_callback);
40 void GetAboutResource(
41 const google_apis::AboutResourceCallback& callback);
44 int64 start_changestamp,
45 const google_apis::GetResourceListCallback& callback);
47 void GetRemainingChangeList(
48 const GURL& next_link,
49 const google_apis::GetResourceListCallback& callback);
51 void GetRemainingFileList(
52 const GURL& next_link,
53 const google_apis::GetResourceListCallback& callback);
55 void GetResourceEntry(
56 const std::string& resource_id,
57 const google_apis::GetResourceEntryCallback& callback);
59 void GetResourceListInDirectory(
60 const std::string& directory_resource_id,
61 const google_apis::GetResourceListCallback& callback);
63 bool HasRefreshToken() const;
65 void RemoveResourceFromDirectory(
66 const std::string& parent_resource_id,
67 const std::string& resource_id,
68 const google_apis::EntryActionCallback& callback);
71 const std::string& title,
72 const std::string& directory_resource_id,
73 const google_apis::GetResourceListCallback& callback);
76 drive::DriveServiceInterface* drive_service_;
78 DISALLOW_COPY_AND_ASSIGN(DriveServiceWrapper);
81 } // namespace drive_backend
82 } // namespace sync_file_system
84 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_SERVICE_WRAPPER_H_