Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/folder_creator.cc

Issue 881403003: Rename gdata_errorcode.h to drive_api_error_codes.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typos in BUILD.gn Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/sync_file_system/drive_backend/folder_creator.h" 5 #include "chrome/browser/sync_file_system/drive_backend/folder_creator.h"
6 6
7 #include "chrome/browser/drive/drive_api_util.h" 7 #include "chrome/browser/drive/drive_api_util.h"
8 #include "chrome/browser/drive/drive_service_interface.h" 8 #include "chrome/browser/drive/drive_service_interface.h"
9 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" 9 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h"
10 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" 10 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h"
(...skipping 25 matching lines...) Expand all
36 drive_service_->AddNewDirectory( 36 drive_service_->AddNewDirectory(
37 parent_folder_id_, 37 parent_folder_id_,
38 title_, 38 title_,
39 drive::DriveServiceInterface::AddNewDirectoryOptions(), 39 drive::DriveServiceInterface::AddNewDirectoryOptions(),
40 base::Bind(&FolderCreator::DidCreateFolder, 40 base::Bind(&FolderCreator::DidCreateFolder,
41 weak_ptr_factory_.GetWeakPtr(), callback)); 41 weak_ptr_factory_.GetWeakPtr(), callback));
42 } 42 }
43 43
44 void FolderCreator::DidCreateFolder( 44 void FolderCreator::DidCreateFolder(
45 const FileIDCallback& callback, 45 const FileIDCallback& callback,
46 google_apis::GDataErrorCode error, 46 google_apis::DriveApiErrorCode error,
47 scoped_ptr<google_apis::FileResource> entry) { 47 scoped_ptr<google_apis::FileResource> entry) {
48 SyncStatusCode status = GDataErrorCodeToSyncStatusCode(error); 48 SyncStatusCode status = DriveApiErrorCodeToSyncStatusCode(error);
49 if (status != SYNC_STATUS_OK) { 49 if (status != SYNC_STATUS_OK) {
50 callback.Run(std::string(), status); 50 callback.Run(std::string(), status);
51 return; 51 return;
52 } 52 }
53 53
54 drive_service_->SearchByTitle( 54 drive_service_->SearchByTitle(
55 title_, parent_folder_id_, 55 title_, parent_folder_id_,
56 base::Bind(&FolderCreator::DidListFolders, 56 base::Bind(&FolderCreator::DidListFolders,
57 weak_ptr_factory_.GetWeakPtr(), callback, 57 weak_ptr_factory_.GetWeakPtr(), callback,
58 base::Passed(ScopedVector<google_apis::FileResource>()))); 58 base::Passed(ScopedVector<google_apis::FileResource>())));
59 } 59 }
60 60
61 void FolderCreator::DidListFolders( 61 void FolderCreator::DidListFolders(
62 const FileIDCallback& callback, 62 const FileIDCallback& callback,
63 ScopedVector<google_apis::FileResource> candidates, 63 ScopedVector<google_apis::FileResource> candidates,
64 google_apis::GDataErrorCode error, 64 google_apis::DriveApiErrorCode error,
65 scoped_ptr<google_apis::FileList> file_list) { 65 scoped_ptr<google_apis::FileList> file_list) {
66 SyncStatusCode status = GDataErrorCodeToSyncStatusCode(error); 66 SyncStatusCode status = DriveApiErrorCodeToSyncStatusCode(error);
67 if (status != SYNC_STATUS_OK) { 67 if (status != SYNC_STATUS_OK) {
68 callback.Run(std::string(), status); 68 callback.Run(std::string(), status);
69 return; 69 return;
70 } 70 }
71 71
72 if (!file_list) { 72 if (!file_list) {
73 NOTREACHED(); 73 NOTREACHED();
74 callback.Run(std::string(), SYNC_STATUS_FAILED); 74 callback.Run(std::string(), SYNC_STATUS_FAILED);
75 return; 75 return;
76 } 76 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if (!metadata_database_->FindFileByFileID(file_id, nullptr)) { 117 if (!metadata_database_->FindFileByFileID(file_id, nullptr)) {
118 callback.Run(std::string(), SYNC_FILE_ERROR_NOT_FOUND); 118 callback.Run(std::string(), SYNC_FILE_ERROR_NOT_FOUND);
119 return; 119 return;
120 } 120 }
121 121
122 callback.Run(file_id, status); 122 callback.Run(file_id, status);
123 } 123 }
124 124
125 } // namespace drive_backend 125 } // namespace drive_backend
126 } // namespace sync_file_system 126 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698