| 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/google_apis/fake_drive_service.h" | 5 #include "chrome/browser/google_apis/fake_drive_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 } | 771 } |
| 772 } | 772 } |
| 773 | 773 |
| 774 scoped_ptr<ResourceEntry> null; | 774 scoped_ptr<ResourceEntry> null; |
| 775 MessageLoop::current()->PostTask( | 775 MessageLoop::current()->PostTask( |
| 776 FROM_HERE, | 776 FROM_HERE, |
| 777 base::Bind(callback, HTTP_NOT_FOUND, base::Passed(&null))); | 777 base::Bind(callback, HTTP_NOT_FOUND, base::Passed(&null))); |
| 778 } | 778 } |
| 779 | 779 |
| 780 void FakeDriveService::InitiateUploadNewFile( | 780 void FakeDriveService::InitiateUploadNewFile( |
| 781 const FilePath& drive_file_path, | 781 const base::FilePath& drive_file_path, |
| 782 const std::string& content_type, | 782 const std::string& content_type, |
| 783 int64 content_length, | 783 int64 content_length, |
| 784 const GURL& parent_upload_url, | 784 const GURL& parent_upload_url, |
| 785 const std::string& title, | 785 const std::string& title, |
| 786 const InitiateUploadCallback& callback) { | 786 const InitiateUploadCallback& callback) { |
| 787 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 787 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 788 DCHECK(!callback.is_null()); | 788 DCHECK(!callback.is_null()); |
| 789 | 789 |
| 790 if (offline_) { | 790 if (offline_) { |
| 791 MessageLoop::current()->PostTask( | 791 MessageLoop::current()->PostTask( |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 | 873 |
| 874 if (resource_list_dict->GetList("entry", &entries)) | 874 if (resource_list_dict->GetList("entry", &entries)) |
| 875 entries->Append(new_entry.release()); | 875 entries->Append(new_entry.release()); |
| 876 | 876 |
| 877 MessageLoop::current()->PostTask( | 877 MessageLoop::current()->PostTask( |
| 878 FROM_HERE, | 878 FROM_HERE, |
| 879 base::Bind(callback, HTTP_SUCCESS, upload_url)); | 879 base::Bind(callback, HTTP_SUCCESS, upload_url)); |
| 880 } | 880 } |
| 881 | 881 |
| 882 void FakeDriveService::InitiateUploadExistingFile( | 882 void FakeDriveService::InitiateUploadExistingFile( |
| 883 const FilePath& drive_file_path, | 883 const base::FilePath& drive_file_path, |
| 884 const std::string& content_type, | 884 const std::string& content_type, |
| 885 int64 content_length, | 885 int64 content_length, |
| 886 const GURL& upload_url, | 886 const GURL& upload_url, |
| 887 const std::string& etag, | 887 const std::string& etag, |
| 888 const InitiateUploadCallback& callback) { | 888 const InitiateUploadCallback& callback) { |
| 889 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 889 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 890 DCHECK(!callback.is_null()); | 890 DCHECK(!callback.is_null()); |
| 891 | 891 |
| 892 if (offline_) { | 892 if (offline_) { |
| 893 MessageLoop::current()->PostTask( | 893 MessageLoop::current()->PostTask( |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 return base::StringPrintf("resource_id_%d", resource_id_count_); | 1082 return base::StringPrintf("resource_id_%d", resource_id_count_); |
| 1083 } | 1083 } |
| 1084 | 1084 |
| 1085 void FakeDriveService::AddNewChangestamp(base::DictionaryValue* entry) { | 1085 void FakeDriveService::AddNewChangestamp(base::DictionaryValue* entry) { |
| 1086 ++largest_changestamp_; | 1086 ++largest_changestamp_; |
| 1087 entry->SetString("docs$changestamp.value", | 1087 entry->SetString("docs$changestamp.value", |
| 1088 base::Int64ToString(largest_changestamp_)); | 1088 base::Int64ToString(largest_changestamp_)); |
| 1089 } | 1089 } |
| 1090 | 1090 |
| 1091 } // namespace google_apis | 1091 } // namespace google_apis |
| OLD | NEW |