| 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 20 matching lines...) Expand all Loading... |
| 31 // specified. | 31 // specified. |
| 32 bool LoadAccountMetadataForWapi(const std::string& relative_path); | 32 bool LoadAccountMetadataForWapi(const std::string& relative_path); |
| 33 | 33 |
| 34 // Loads the app list for Drive API. Returns true on success. | 34 // Loads the app list for Drive API. Returns true on success. |
| 35 bool LoadAppListForDriveApi(const std::string& relative_path); | 35 bool LoadAppListForDriveApi(const std::string& relative_path); |
| 36 | 36 |
| 37 // Changes the offline state. All functions fail with GDATA_NO_CONNECTION | 37 // Changes the offline state. All functions fail with GDATA_NO_CONNECTION |
| 38 // when offline. By default the offline state is false. | 38 // when offline. By default the offline state is false. |
| 39 void set_offline(bool offline) { offline_ = offline; } | 39 void set_offline(bool offline) { offline_ = offline; } |
| 40 | 40 |
| 41 // Changes the default max results returned from GetResourceList(). |
| 42 // By default, it's set to 0, which is unlimited. |
| 43 void set_default_max_results(int default_max_results) { |
| 44 default_max_results_ = default_max_results; |
| 45 } |
| 46 |
| 41 // Returns the largest changestamp, which starts from 0 by default. See | 47 // Returns the largest changestamp, which starts from 0 by default. See |
| 42 // also comments at LoadAccountMetadataForWapi(). | 48 // also comments at LoadAccountMetadataForWapi(). |
| 43 int64 largest_changestamp() const { return largest_changestamp_; } | 49 int64 largest_changestamp() const { return largest_changestamp_; } |
| 44 | 50 |
| 45 // Returns the number of times the resource list is successfully loaded by | 51 // Returns the number of times the resource list is successfully loaded by |
| 46 // GetResourceList(). | 52 // GetResourceList(). |
| 47 int resource_list_load_count() const { return resource_list_load_count_; } | 53 int resource_list_load_count() const { return resource_list_load_count_; } |
| 48 | 54 |
| 49 // Returns the number of times the account metadata is successfully loaded | 55 // Returns the number of times the account metadata is successfully loaded |
| 50 // by GetAccountMetadata(). | 56 // by GetAccountMetadata(). |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 std::string GetNewResourceId(); | 143 std::string GetNewResourceId(); |
| 138 | 144 |
| 139 // Increments |largest_changestamp_| and adds the new changestamp to | 145 // Increments |largest_changestamp_| and adds the new changestamp to |
| 140 // |entry|. | 146 // |entry|. |
| 141 void AddNewChangestamp(base::DictionaryValue* entry); | 147 void AddNewChangestamp(base::DictionaryValue* entry); |
| 142 | 148 |
| 143 scoped_ptr<base::Value> resource_list_value_; | 149 scoped_ptr<base::Value> resource_list_value_; |
| 144 scoped_ptr<base::Value> account_metadata_value_; | 150 scoped_ptr<base::Value> account_metadata_value_; |
| 145 scoped_ptr<base::Value> app_info_value_; | 151 scoped_ptr<base::Value> app_info_value_; |
| 146 int64 largest_changestamp_; | 152 int64 largest_changestamp_; |
| 153 int default_max_results_; |
| 147 int resource_id_count_; | 154 int resource_id_count_; |
| 148 int resource_list_load_count_; | 155 int resource_list_load_count_; |
| 149 int account_metadata_load_count_; | 156 int account_metadata_load_count_; |
| 150 bool offline_; | 157 bool offline_; |
| 151 | 158 |
| 152 DISALLOW_COPY_AND_ASSIGN(FakeDriveService); | 159 DISALLOW_COPY_AND_ASSIGN(FakeDriveService); |
| 153 }; | 160 }; |
| 154 | 161 |
| 155 } // namespace google_apis | 162 } // namespace google_apis |
| 156 | 163 |
| 157 #endif // CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ | 164 #endif // CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ |
| OLD | NEW |