OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ |
6 #define CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ |
7 | 7 |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/google_apis/drive_service_interface.h" | 9 #include "chrome/browser/google_apis/drive_service_interface.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // Loads the resource list for WAPI. Returns true on success. | 26 // Loads the resource list for WAPI. Returns true on success. |
27 bool LoadResourceListForWapi(const std::string& relative_path); | 27 bool LoadResourceListForWapi(const std::string& relative_path); |
28 | 28 |
29 // Loads the account metadata for WAPI. Returns true on success. | 29 // Loads the account metadata for WAPI. Returns true on success. |
30 bool LoadAccountMetadataForWapi(const std::string& relative_path); | 30 bool LoadAccountMetadataForWapi(const std::string& relative_path); |
31 | 31 |
32 // Loads the application info for Drive API. Returns true on success. | 32 // Loads the application info for Drive API. Returns true on success. |
33 bool LoadApplicationInfoForDriveApi(const std::string& relative_path); | 33 bool LoadApplicationInfoForDriveApi(const std::string& relative_path); |
34 | 34 |
| 35 // Changes the offline state. All functions fail with GDATA_NO_CONNECTION |
| 36 // when offline. By default the offline state is false. |
| 37 void set_offline(bool offline) { offline_ = offline; } |
| 38 |
35 // DriveServiceInterface Overrides | 39 // DriveServiceInterface Overrides |
36 virtual void Initialize(Profile* profile) OVERRIDE; | 40 virtual void Initialize(Profile* profile) OVERRIDE; |
37 virtual void AddObserver(DriveServiceObserver* observer) OVERRIDE; | 41 virtual void AddObserver(DriveServiceObserver* observer) OVERRIDE; |
38 virtual void RemoveObserver(DriveServiceObserver* observer) OVERRIDE; | 42 virtual void RemoveObserver(DriveServiceObserver* observer) OVERRIDE; |
39 virtual bool CanStartOperation() const OVERRIDE; | 43 virtual bool CanStartOperation() const OVERRIDE; |
40 virtual void CancelAll() OVERRIDE; | 44 virtual void CancelAll() OVERRIDE; |
41 virtual bool CancelForFilePath(const FilePath& file_path) OVERRIDE; | 45 virtual bool CancelForFilePath(const FilePath& file_path) OVERRIDE; |
42 virtual OperationProgressStatusList GetProgressStatusList() const OVERRIDE; | 46 virtual OperationProgressStatusList GetProgressStatusList() const OVERRIDE; |
43 virtual bool HasAccessToken() const OVERRIDE; | 47 virtual bool HasAccessToken() const OVERRIDE; |
44 virtual bool HasRefreshToken() const OVERRIDE; | 48 virtual bool HasRefreshToken() const OVERRIDE; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 base::DictionaryValue* FindEntryByContentUrl(const GURL& content_url); | 116 base::DictionaryValue* FindEntryByContentUrl(const GURL& content_url); |
113 | 117 |
114 // Returns a new resource ID, which looks like "resource_id_<num>" where | 118 // Returns a new resource ID, which looks like "resource_id_<num>" where |
115 // <num> is a monotonically increasing number starting from 1. | 119 // <num> is a monotonically increasing number starting from 1. |
116 std::string GetNewResourceId(); | 120 std::string GetNewResourceId(); |
117 | 121 |
118 scoped_ptr<base::Value> resource_list_value_; | 122 scoped_ptr<base::Value> resource_list_value_; |
119 scoped_ptr<base::Value> account_metadata_value_; | 123 scoped_ptr<base::Value> account_metadata_value_; |
120 scoped_ptr<base::Value> app_info_value_; | 124 scoped_ptr<base::Value> app_info_value_; |
121 int resource_id_count_; | 125 int resource_id_count_; |
| 126 bool offline_; |
122 | 127 |
123 DISALLOW_COPY_AND_ASSIGN(FakeDriveService); | 128 DISALLOW_COPY_AND_ASSIGN(FakeDriveService); |
124 }; | 129 }; |
125 | 130 |
126 } // namespace google_apis | 131 } // namespace google_apis |
127 | 132 |
128 #endif // CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ | 133 #endif // CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ |
OLD | NEW |