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 #include "chrome/browser/drive/fake_drive_service.h" | 5 #include "chrome/browser/drive/fake_drive_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 directory_load_count_(0), | 233 directory_load_count_(0), |
234 about_resource_load_count_(0), | 234 about_resource_load_count_(0), |
235 app_list_load_count_(0), | 235 app_list_load_count_(0), |
236 blocked_file_list_load_count_(0), | 236 blocked_file_list_load_count_(0), |
237 offline_(false), | 237 offline_(false), |
238 never_return_all_file_list_(false), | 238 never_return_all_file_list_(false), |
239 share_url_base_("https://share_url/"), | 239 share_url_base_("https://share_url/"), |
240 weak_ptr_factory_(this) { | 240 weak_ptr_factory_(this) { |
241 about_resource_->set_largest_change_id(654321); | 241 about_resource_->set_largest_change_id(654321); |
242 about_resource_->set_quota_bytes_total(9876543210); | 242 about_resource_->set_quota_bytes_total(9876543210); |
243 about_resource_->set_quota_bytes_used(6789012345); | 243 about_resource_->set_quota_bytes_used_aggregate(6789012345); |
244 about_resource_->set_root_folder_id(GetRootResourceId()); | 244 about_resource_->set_root_folder_id(GetRootResourceId()); |
245 } | 245 } |
246 | 246 |
247 FakeDriveService::~FakeDriveService() { | 247 FakeDriveService::~FakeDriveService() { |
248 DCHECK(thread_checker_.CalledOnValidThread()); | 248 DCHECK(thread_checker_.CalledOnValidThread()); |
249 STLDeleteValues(&entries_); | 249 STLDeleteValues(&entries_); |
250 } | 250 } |
251 | 251 |
252 bool FakeDriveService::LoadAppListForDriveApi( | 252 bool FakeDriveService::LoadAppListForDriveApi( |
253 const std::string& relative_path) { | 253 const std::string& relative_path) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 return true; | 319 return true; |
320 } | 320 } |
321 } | 321 } |
322 | 322 |
323 return false; | 323 return false; |
324 } | 324 } |
325 | 325 |
326 void FakeDriveService::SetQuotaValue(int64 used, int64 total) { | 326 void FakeDriveService::SetQuotaValue(int64 used, int64 total) { |
327 DCHECK(thread_checker_.CalledOnValidThread()); | 327 DCHECK(thread_checker_.CalledOnValidThread()); |
328 | 328 |
329 about_resource_->set_quota_bytes_used(used); | 329 about_resource_->set_quota_bytes_used_aggregate(used); |
330 about_resource_->set_quota_bytes_total(total); | 330 about_resource_->set_quota_bytes_total(total); |
331 } | 331 } |
332 | 332 |
333 GURL FakeDriveService::GetFakeLinkUrl(const std::string& resource_id) { | 333 GURL FakeDriveService::GetFakeLinkUrl(const std::string& resource_id) { |
334 return GURL("https://fake_server/" + net::EscapePath(resource_id)); | 334 return GURL("https://fake_server/" + net::EscapePath(resource_id)); |
335 } | 335 } |
336 | 336 |
337 void FakeDriveService::Initialize(const std::string& account_id) { | 337 void FakeDriveService::Initialize(const std::string& account_id) { |
338 DCHECK(thread_checker_.CalledOnValidThread()); | 338 DCHECK(thread_checker_.CalledOnValidThread()); |
339 } | 339 } |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1778 | 1778 |
1779 NOTREACHED(); | 1779 NOTREACHED(); |
1780 return scoped_ptr<BatchRequestConfiguratorInterface>(); | 1780 return scoped_ptr<BatchRequestConfiguratorInterface>(); |
1781 } | 1781 } |
1782 | 1782 |
1783 void FakeDriveService::NotifyObservers() { | 1783 void FakeDriveService::NotifyObservers() { |
1784 FOR_EACH_OBSERVER(ChangeObserver, change_observers_, OnNewChangeAvailable()); | 1784 FOR_EACH_OBSERVER(ChangeObserver, change_observers_, OnNewChangeAvailable()); |
1785 } | 1785 } |
1786 | 1786 |
1787 } // namespace drive | 1787 } // namespace drive |
OLD | NEW |