15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 57d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#ifndef CHROME_BROWSER_DRIVE_DRIVE_SERVICE_INTERFACE_H_ 67d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#define CHROME_BROWSER_DRIVE_DRIVE_SERVICE_INTERFACE_H_ 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string> 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/time/time.h" 11a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "google_apis/drive/auth_service_interface.h" 12a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "google_apis/drive/base_requests.h" 13a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "google_apis/drive/drive_api_requests.h" 14a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "google_apis/drive/drive_common_callbacks.h" 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 16f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)namespace base { 17f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)class Time; 18f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)} 19f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 20eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochnamespace drive { 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Observer interface for DriveServiceInterface. 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class DriveServiceObserver { 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public: 25868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // Triggered when the service gets ready to send requests. 26868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) virtual void OnReadyToSendRequests() {} 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Called when the refresh token was found to be invalid. 292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void OnRefreshTokenInvalid() {} 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) protected: 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual ~DriveServiceObserver() {} 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This defines an interface for sharing by DriveService and MockDriveService 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// so that we can do testing of clients of DriveService. 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// All functions must be called on UI thread. DriveService is built on top of 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// URLFetcher that runs on UI thread. 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class DriveServiceInterface { 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public: 425d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Optional parameters for AddNewDirectory(). 435d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) struct AddNewDirectoryOptions { 445d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) AddNewDirectoryOptions(); 455d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ~AddNewDirectoryOptions(); 465d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 475d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // modified_date of the directory. 485d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Pass the null Time if you are not interested in setting this property. 495d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) base::Time modified_date; 505d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 515d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // last_viewed_by_me_date of the directory. 525d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Pass the null Time if you are not interested in setting this property. 535d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) base::Time last_viewed_by_me_date; 545d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) }; 555d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 565d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Optional parameters for InitiateUploadNewFile(). 575d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) struct InitiateUploadNewFileOptions { 585d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) InitiateUploadNewFileOptions(); 595d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ~InitiateUploadNewFileOptions(); 605d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 615d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // modified_date of the file. 625d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Pass the null Time if you are not interested in setting this property. 635d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) base::Time modified_date; 645d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 655d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // last_viewed_by_me_date of the file. 665d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Pass the null Time if you are not interested in setting this property. 675d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) base::Time last_viewed_by_me_date; 685d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) }; 695d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 705d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Optional parameters for InitiateUploadExistingFile(). 715d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) struct InitiateUploadExistingFileOptions { 725d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) InitiateUploadExistingFileOptions(); 735d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ~InitiateUploadExistingFileOptions(); 745d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 755d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Expected ETag of the file. UPLOAD_ERROR_CONFLICT error is generated when 765d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // matching fails. 775d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Pass the empty string to disable this behavior. 785d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) std::string etag; 795d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 805d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // New parent of the file. 815d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Pass the empty string to keep the property unchanged. 825d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) std::string parent_resource_id; 835d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 845d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // New title of the file. 855d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Pass the empty string to keep the property unchanged. 865d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) std::string title; 875d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 885d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // New modified_date of the file. 895d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Pass the null Time if you are not interested in setting this property. 905d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) base::Time modified_date; 915d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 925d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // New last_viewed_by_me_date of the file. 935d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Pass the null Time if you are not interested in setting this property. 945d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) base::Time last_viewed_by_me_date; 955d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) }; 965d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual ~DriveServiceInterface() {} 985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Common service: 1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 10168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) // Initializes the documents service with |account_id|. 10268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) virtual void Initialize(const std::string& account_id) = 0; 1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Adds an observer. 1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void AddObserver(DriveServiceObserver* observer) = 0; 1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Removes an observer. 1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void RemoveObserver(DriveServiceObserver* observer) = 0; 1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 110868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // True if ready to send requests. 111868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) virtual bool CanSendRequest() const = 0; 1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Authentication service: 1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // True if OAuth2 access token is retrieved and believed to be fresh. 1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual bool HasAccessToken() const = 0; 1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1187dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch // Gets the cached OAuth2 access token or if empty, then fetches a new one. 1197dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch virtual void RequestAccessToken( 1207dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch const google_apis::AuthStatusCallback& callback) = 0; 1217dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch 1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // True if OAuth2 refresh token is present. 1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual bool HasRefreshToken() const = 0; 1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Clears OAuth2 access token. 1262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void ClearAccessToken() = 0; 1272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Clears OAuth2 refresh token. 1292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void ClearRefreshToken() = 0; 1302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Document access: 1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Returns the resource id for the root directory. 1342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual std::string GetRootResourceId() const = 0; 1352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 13646d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) // Fetches a file list of the account. |callback| will be called upon 137c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // completion. 138c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // If the list is too long, it may be paged. In such a case, a URL to fetch 139c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // remaining results will be included in the returned result. See also 140f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // GetRemainingFileList. 1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // 142c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // |callback| must not be null. 14346d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) virtual google_apis::CancelCallback GetAllFileList( 14446d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::FileListCallback& callback) = 0; 145c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 14646d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) // Fetches a file list in the directory with |directory_resource_id|. 147c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // |callback| will be called upon completion. 148c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // If the list is too long, it may be paged. In such a case, a URL to fetch 149c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // remaining results will be included in the returned result. See also 150f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // GetRemainingFileList. 1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // 152c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // |directory_resource_id| must not be empty. 153c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // |callback| must not be null. 15446d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) virtual google_apis::CancelCallback GetFileListInDirectory( 155c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) const std::string& directory_resource_id, 15646d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::FileListCallback& callback) = 0; 157c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 158c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // Searches the resources for the |search_query| from all the user's 159c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // resources. |callback| will be called upon completion. 160c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // If the list is too long, it may be paged. In such a case, a URL to fetch 161c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // remaining results will be included in the returned result. See also 162f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // GetRemainingFileList. 163c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // 164c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // |search_query| must not be empty. 165c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // |callback| must not be null. 166eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback Search( 167c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) const std::string& search_query, 16846d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::FileListCallback& callback) = 0; 169c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 170c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // Searches the resources with the |title|. 1717d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) // |directory_resource_id| is an optional parameter. If it is empty, 172c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // the search target is all the existing resources. Otherwise, it is 173c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // the resources directly under the directory with |directory_resource_id|. 174c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // If the list is too long, it may be paged. In such a case, a URL to fetch 175c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // remaining results will be included in the returned result. See also 176f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // GetRemainingFileList. 177c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // 178c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // |title| must not be empty, and |callback| must not be null. 179eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback SearchByTitle( 180c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) const std::string& title, 181c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) const std::string& directory_resource_id, 18246d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::FileListCallback& callback) = 0; 183c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 184c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // Fetches change list since |start_changestamp|. |callback| will be 185c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // called upon completion. 186c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // If the list is too long, it may be paged. In such a case, a URL to fetch 187c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // remaining results will be included in the returned result. See also 188f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // GetRemainingChangeList. 1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // 1902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 191eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback GetChangeList( 192c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) int64 start_changestamp, 193cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) const google_apis::ChangeListCallback& callback) = 0; 194c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 195cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // The result of GetChangeList() may be paged. 19658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // In such a case, a next link to fetch remaining result is returned. 197424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) // The page token can be used for this method. |callback| will be called upon 198424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) // completion. 199424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) // 20058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // |next_link| must not be empty. |callback| must not be null. 201424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) virtual google_apis::CancelCallback GetRemainingChangeList( 20258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) const GURL& next_link, 203cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) const google_apis::ChangeListCallback& callback) = 0; 204424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) 20546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) // The result of GetAllFileList(), GetFileListInDirectory(), Search() 206cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // and SearchByTitle() may be paged. In such a case, a next link to fetch 207cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // remaining result is returned. The page token can be used for this method. 208cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // |callback| will be called upon completion. 209424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) // 21058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // |next_link| must not be empty. |callback| must not be null. 211424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) virtual google_apis::CancelCallback GetRemainingFileList( 21258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) const GURL& next_link, 21346d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::FileListCallback& callback) = 0; 214424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) 21546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) // Fetches single entry metadata from server. The entry's file id equals 2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // |resource_id|. 2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Upon completion, invokes |callback| with results on the calling thread. 2182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 21946d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) virtual google_apis::CancelCallback GetFileResource( 2207d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& resource_id, 22146d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::FileResourceCallback& callback) = 0; 2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 223bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch // Fetches an url for the sharing dialog for a single entry with id 224bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch // |resource_id|, to be embedded in a webview or an iframe with origin 225bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch // |embed_origin|. The url is returned via |callback| with results on the 226bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch // calling thread. |callback| must not be null. 227bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch virtual google_apis::CancelCallback GetShareUrl( 228bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch const std::string& resource_id, 229bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch const GURL& embed_origin, 230bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch const google_apis::GetShareUrlCallback& callback) = 0; 231bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch 2322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Gets the about resource information from the server. 2335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Upon completion, invokes |callback| with results on the calling thread. 2342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 235eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback GetAboutResource( 236424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) const google_apis::AboutResourceCallback& callback) = 0; 2375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Gets the application information from the server. 2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Upon completion, invokes |callback| with results on the calling thread. 2402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 241eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback GetAppList( 242424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) const google_apis::AppListCallback& callback) = 0; 2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2445d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Permanently deletes a resource identified by its |resource_id|. 2452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // If |etag| is not empty and did not match, the deletion fails with 2462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // HTTP_PRECONDITION error. 2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Upon completion, invokes |callback| with results on the calling thread. 2482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 249eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback DeleteResource( 2507d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& resource_id, 2517d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& etag, 252eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const google_apis::EntryActionCallback& callback) = 0; 2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2545d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Trashes a resource identified by its |resource_id|. 2555d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Upon completion, invokes |callback| with results on the calling thread. 2565d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // |callback| must not be null. 2575d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual google_apis::CancelCallback TrashResource( 2585d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const std::string& resource_id, 2595d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const google_apis::EntryActionCallback& callback) = 0; 2605d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 26190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) // Makes a copy of a resource with |resource_id|. 26290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) // The new resource will be put under a directory with |parent_resource_id|, 2637dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch // and it'll be named |new_title|. 26468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) // If |last_modified| is not null, the modified date of the resource on the 26568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) // server will be set to the date. 266868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // This request is supported only on DriveAPIService, because GData WAPI 26790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) // doesn't support the function unfortunately. 26890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) // Upon completion, invokes |callback| with results on the calling thread. 26990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) // |callback| must not be null. 270eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback CopyResource( 2717d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& resource_id, 2727d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& parent_resource_id, 2737dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch const std::string& new_title, 27468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) const base::Time& last_modified, 27546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::FileResourceCallback& callback) = 0; 27690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 277f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // Updates a resource with |resource_id| to the directory of 2783551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) // |parent_resource_id| with renaming to |new_title|. 279f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // If |last_modified| or |last_accessed| is not null, the modified/accessed 280f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // date of the resource on the server will be set to the date. 2813551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) // This request is supported only on DriveAPIService, because GData WAPI 2823551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) // doesn't support the function unfortunately. 2833551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) // Upon completion, invokes |callback| with results on the calling thread. 2843551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) // |callback| must not be null. 285f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual google_apis::CancelCallback UpdateResource( 2863551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) const std::string& resource_id, 2873551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) const std::string& parent_resource_id, 2883551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) const std::string& new_title, 28968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) const base::Time& last_modified, 290f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) const base::Time& last_viewed_by_me, 29146d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::FileResourceCallback& callback) = 0; 2923551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 2935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Adds a resource (document, file, or collection) identified by its 2942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |resource_id| to a collection represented by the |parent_resource_id|. 2952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Upon completion, invokes |callback| with results on the calling thread. 2962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 297eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback AddResourceToDirectory( 2987d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& parent_resource_id, 2997d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& resource_id, 300eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const google_apis::EntryActionCallback& callback) = 0; 3015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Removes a resource (document, file, collection) identified by its 3032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |resource_id| from a collection represented by the |parent_resource_id|. 3042a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Upon completion, invokes |callback| with results on the calling thread. 3052a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 306eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback RemoveResourceFromDirectory( 3072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const std::string& parent_resource_id, 3085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) const std::string& resource_id, 309eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const google_apis::EntryActionCallback& callback) = 0; 3105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3117dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch // Adds new collection with |directory_title| under parent directory 3122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // identified with |parent_resource_id|. |parent_resource_id| can be the 3132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // value returned by GetRootResourceId to represent the root directory. 3142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Upon completion, invokes |callback| and passes newly created entry on 3152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // the calling thread. 3165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // This function cannot be named as "CreateDirectory" as it conflicts with 3175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // a macro on Windows. 3182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 319eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback AddNewDirectory( 3207d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& parent_resource_id, 3217dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch const std::string& directory_title, 3225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const AddNewDirectoryOptions& options, 32346d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::FileResourceCallback& callback) = 0; 3245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 325eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch // Downloads a file with |resourced_id|. The downloaded file will 3265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // be stored at |local_cache_path| location. Upon completion, invokes 3275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // |download_action_callback| with results on the calling thread. 3285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // If |get_content_callback| is not empty, 3295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // URLFetcherDelegate::OnURLFetchDownloadData will be called, which will in 3305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // turn invoke |get_content_callback| on the calling thread. 331c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // If |progress_callback| is not empty, it is invoked periodically when 332c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // the download made some progress. 3332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // 3342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |download_action_callback| must not be null. 335c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // |get_content_callback| and |progress_callback| may be null. 336eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback DownloadFile( 3372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const base::FilePath& local_cache_path, 338eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const std::string& resource_id, 339eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const google_apis::DownloadActionCallback& download_action_callback, 340eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const google_apis::GetContentCallback& get_content_callback, 341eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const google_apis::ProgressCallback& progress_callback) = 0; 3425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Initiates uploading of a new document/file. 3442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |content_type| and |content_length| should be the ones of the file to be 3452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // uploaded. 3462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 347eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback InitiateUploadNewFile( 3482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const std::string& content_type, 3492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int64 content_length, 3502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const std::string& parent_resource_id, 3512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const std::string& title, 3525d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const InitiateUploadNewFileOptions& options, 353eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const google_apis::InitiateUploadCallback& callback) = 0; 3542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 3552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Initiates uploading of an existing document/file. 3562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |content_type| and |content_length| should be the ones of the file to be 3572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // uploaded. 3582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 359eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback InitiateUploadExistingFile( 3602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const std::string& content_type, 3612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int64 content_length, 3622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const std::string& resource_id, 3635d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const InitiateUploadExistingFileOptions& options, 364eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const google_apis::InitiateUploadCallback& callback) = 0; 3655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Resumes uploading of a document/file on the calling thread. 367c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // |callback| must not be null. |progress_callback| may be null. 368eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback ResumeUpload( 3692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const GURL& upload_url, 3702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int64 start_position, 3712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int64 end_position, 3722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int64 content_length, 3732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const std::string& content_type, 374a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) const base::FilePath& local_file_path, 37546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::drive::UploadRangeCallback& callback, 376eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const google_apis::ProgressCallback& progress_callback) = 0; 3772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 3782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Gets the current status of the uploading to |upload_url| from the server. 37990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) // |drive_file_path| and |content_length| should be set to the same value 38090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) // which is used for ResumeUpload. 3812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // |callback| must not be null. 382eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback GetUploadStatus( 3832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const GURL& upload_url, 3842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int64 content_length, 38546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) const google_apis::drive::UploadRangeCallback& callback) = 0; 3862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 3872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Authorizes a Drive app with the id |app_id| to open the given file. 3882a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Upon completion, invokes |callback| with the link to open the file with 3892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // the provided app. |callback| must not be null. 390eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual google_apis::CancelCallback AuthorizeApp( 3917d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& resource_id, 3927d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& app_id, 393eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch const google_apis::AuthorizeAppCallback& callback) = 0; 39458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 3955d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Uninstalls a Drive app with the id |app_id|. |callback| must not be null. 3965d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual google_apis::CancelCallback UninstallApp( 3975d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const std::string& app_id, 3985d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const google_apis::EntryActionCallback& callback) = 0; 3995d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 400a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Authorizes the account |email| to access |resource_id| as a |role|. 401a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // 402a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // |callback| must not be null. 403a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual google_apis::CancelCallback AddPermission( 404a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) const std::string& resource_id, 405a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) const std::string& email, 406a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) google_apis::drive::PermissionRole role, 407a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) const google_apis::EntryActionCallback& callback) = 0; 4085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 4095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 410eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch} // namespace drive 4115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4127d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#endif // CHROME_BROWSER_DRIVE_DRIVE_SERVICE_INTERFACE_H_ 413