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 application info for Drive API. Returns true on success. | 34 // Loads the application info for Drive API. Returns true on success. |
35 bool LoadApplicationInfoForDriveApi(const std::string& relative_path); | 35 bool LoadApplicationInfoForDriveApi(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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 std::string GetNewResourceId(); | 142 std::string GetNewResourceId(); |
137 | 143 |
138 // Increments |largest_changestamp_| and adds the new changestamp to | 144 // Increments |largest_changestamp_| and adds the new changestamp to |
139 // |entry|. | 145 // |entry|. |
140 void AddNewChangestamp(base::DictionaryValue* entry); | 146 void AddNewChangestamp(base::DictionaryValue* entry); |
141 | 147 |
142 scoped_ptr<base::Value> resource_list_value_; | 148 scoped_ptr<base::Value> resource_list_value_; |
143 scoped_ptr<base::Value> account_metadata_value_; | 149 scoped_ptr<base::Value> account_metadata_value_; |
144 scoped_ptr<base::Value> app_info_value_; | 150 scoped_ptr<base::Value> app_info_value_; |
145 int64 largest_changestamp_; | 151 int64 largest_changestamp_; |
| 152 int default_max_results_; |
146 int resource_id_count_; | 153 int resource_id_count_; |
147 int resource_list_load_count_; | 154 int resource_list_load_count_; |
148 int account_metadata_load_count_; | 155 int account_metadata_load_count_; |
149 bool offline_; | 156 bool offline_; |
150 | 157 |
151 DISALLOW_COPY_AND_ASSIGN(FakeDriveService); | 158 DISALLOW_COPY_AND_ASSIGN(FakeDriveService); |
152 }; | 159 }; |
153 | 160 |
154 } // namespace google_apis | 161 } // namespace google_apis |
155 | 162 |
156 #endif // CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ | 163 #endif // CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ |
OLD | NEW |