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/chromeos/drive/file_errors.h" | 5 #include "chrome/browser/chromeos/drive/file_errors.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace drive { | 9 namespace drive { |
10 | 10 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 return base::File::FILE_ERROR_FAILED; | 129 return base::File::FILE_ERROR_FAILED; |
130 | 130 |
131 case FILE_ERROR_SERVICE_UNAVAILABLE: | 131 case FILE_ERROR_SERVICE_UNAVAILABLE: |
132 return base::File::FILE_ERROR_FAILED; | 132 return base::File::FILE_ERROR_FAILED; |
133 } | 133 } |
134 | 134 |
135 NOTREACHED(); | 135 NOTREACHED(); |
136 return base::File::FILE_ERROR_FAILED; | 136 return base::File::FILE_ERROR_FAILED; |
137 } | 137 } |
138 | 138 |
139 FileError GDataToFileError(google_apis::GDataErrorCode status) { | 139 FileError GDataToFileError(google_apis::DriveApiErrorCode status) { |
140 switch (status) { | 140 switch (status) { |
141 case google_apis::HTTP_SUCCESS: | 141 case google_apis::HTTP_SUCCESS: |
142 case google_apis::HTTP_CREATED: | 142 case google_apis::HTTP_CREATED: |
143 case google_apis::HTTP_NO_CONTENT: | 143 case google_apis::HTTP_NO_CONTENT: |
144 return FILE_ERROR_OK; | 144 return FILE_ERROR_OK; |
145 case google_apis::HTTP_UNAUTHORIZED: | 145 case google_apis::HTTP_UNAUTHORIZED: |
146 case google_apis::HTTP_FORBIDDEN: | 146 case google_apis::HTTP_FORBIDDEN: |
147 return FILE_ERROR_ACCESS_DENIED; | 147 return FILE_ERROR_ACCESS_DENIED; |
148 case google_apis::HTTP_NOT_FOUND: | 148 case google_apis::HTTP_NOT_FOUND: |
149 case google_apis::HTTP_GONE: | 149 case google_apis::HTTP_GONE: |
150 return FILE_ERROR_NOT_FOUND; | 150 return FILE_ERROR_NOT_FOUND; |
151 case google_apis::HTTP_INTERNAL_SERVER_ERROR: | 151 case google_apis::HTTP_INTERNAL_SERVER_ERROR: |
152 case google_apis::HTTP_SERVICE_UNAVAILABLE: | 152 case google_apis::HTTP_SERVICE_UNAVAILABLE: |
153 return FILE_ERROR_SERVICE_UNAVAILABLE; | 153 return FILE_ERROR_SERVICE_UNAVAILABLE; |
154 case google_apis::HTTP_NOT_IMPLEMENTED: | 154 case google_apis::HTTP_NOT_IMPLEMENTED: |
155 return FILE_ERROR_INVALID_OPERATION; | 155 return FILE_ERROR_INVALID_OPERATION; |
156 case google_apis::GDATA_CANCELLED: | 156 case google_apis::DRIVE_CANCELLED: |
157 return FILE_ERROR_ABORT; | 157 return FILE_ERROR_ABORT; |
158 case google_apis::GDATA_NO_CONNECTION: | 158 case google_apis::DRIVE_NO_CONNECTION: |
159 return FILE_ERROR_NO_CONNECTION; | 159 return FILE_ERROR_NO_CONNECTION; |
160 case google_apis::GDATA_NO_SPACE: | 160 case google_apis::DRIVE_NO_SPACE: |
161 return FILE_ERROR_NO_SERVER_SPACE; | 161 return FILE_ERROR_NO_SERVER_SPACE; |
162 default: | 162 default: |
163 return FILE_ERROR_FAILED; | 163 return FILE_ERROR_FAILED; |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 } // namespace drive | 167 } // namespace drive |
OLD | NEW |