Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2020)

Unified Diff: chrome/browser/google_apis/fake_drive_service.h

Issue 11825021: google_apis: Implement more functions in FakeDriveService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/google_apis/fake_drive_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/fake_drive_service.h
diff --git a/chrome/browser/google_apis/fake_drive_service.h b/chrome/browser/google_apis/fake_drive_service.h
index 876509e996b79c500ac5a92e52541b342ab7b3e7..0becffd28fb5a96acc8e3fc6d773caa6d7dd1733 100644
--- a/chrome/browser/google_apis/fake_drive_service.h
+++ b/chrome/browser/google_apis/fake_drive_service.h
@@ -29,6 +29,9 @@ class FakeDriveService : public DriveServiceInterface {
// Loads the account metadata for WAPI. Returns true on success.
bool LoadAccountMetadataForWapi(const std::string& relative_path);
+ // Loads the application info for Drive API. Returns true on success.
+ bool LoadApplicationInfoForDriveApi(const std::string& relative_path);
+
// DriveServiceInterface Overrides
virtual void Initialize(Profile* profile) OVERRIDE;
virtual void AddObserver(DriveServiceObserver* observer) OVERRIDE;
@@ -66,6 +69,8 @@ class FakeDriveService : public DriveServiceInterface {
const GURL& content_url,
const DownloadActionCallback& download_action_callback,
const GetContentCallback& get_content_callback) OVERRIDE;
+ // The new resource ID for the copied document will look like
+ // |resource_id| + "_copied".
virtual void CopyHostedDocument(
const std::string& resource_id,
const FilePath::StringType& new_name,
@@ -94,8 +99,27 @@ class FakeDriveService : public DriveServiceInterface {
const AuthorizeAppCallback& callback) OVERRIDE;
private:
+ // Returns a pointer to the entry that matches |resource_id|, or NULL if
+ // not found.
+ base::DictionaryValue* FindEntryByResourceId(const std::string& resource_id);
+
+ // Returns a pointer to the entry that matches |edit_url|, or NULL if not
+ // found.
+ base::DictionaryValue* FindEntryByEditUrl(const GURL& edit_url);
+
+ // Returns a pointer to the entry that matches |content_url|, or NULL if
+ // not found.
+ base::DictionaryValue* FindEntryByContentUrl(const GURL& content_url);
+
+ // Returns a new resource ID, which looks like "resource_id_<num>" where
+ // <num> is a monotonically increasing number starting from 1.
+ std::string GetNewResourceId();
+
scoped_ptr<base::Value> resource_list_value_;
scoped_ptr<base::Value> account_metadata_value_;
+ scoped_ptr<base::Value> app_info_value_;
+ int resource_id_count_;
+
DISALLOW_COPY_AND_ASSIGN(FakeDriveService);
};
« no previous file with comments | « no previous file | chrome/browser/google_apis/fake_drive_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698