| Index: chrome/browser/chromeos/gdata/operations_base.cc
|
| diff --git a/chrome/browser/chromeos/gdata/operations_base.cc b/chrome/browser/chromeos/gdata/operations_base.cc
|
| index 12701ccb040686169a2f6be2454873420e52e273..96be352e2ef18121b5ccaa52f990fb2011e4afe0 100644
|
| --- a/chrome/browser/chromeos/gdata/operations_base.cc
|
| +++ b/chrome/browser/chromeos/gdata/operations_base.cc
|
| @@ -119,7 +119,7 @@ void AuthOperation::Start() {
|
| void AuthOperation::DoCancel() {
|
| oauth2_access_token_fetcher_->CancelRequest();
|
| if (!callback_.is_null())
|
| - callback_.Run(GDATA_CANCELLED, std::string());
|
| + callback_.Run(DRIVE_CANCELLED, std::string());
|
| }
|
|
|
| // Callback for OAuth2AccessTokenFetcher on success. |access_token| is the token
|
| @@ -150,7 +150,7 @@ void AuthOperation::OnGetTokenFailure(const GoogleServiceAuthError& error) {
|
| UMA_HISTOGRAM_ENUMERATION("GData.AuthSuccess",
|
| kSuccessRatioHistogramNoConnection,
|
| kSuccessRatioHistogramMaxValue);
|
| - callback_.Run(GDATA_NO_CONNECTION, std::string());
|
| + callback_.Run(DRIVE_NO_CONNECTION, std::string());
|
| } else {
|
| UMA_HISTOGRAM_ENUMERATION("GData.AuthSuccess",
|
| kSuccessRatioHistogramFailure,
|
| @@ -251,16 +251,16 @@ bool UrlFetchOperationBase::GetContentData(std::string* upload_content_type,
|
|
|
| void UrlFetchOperationBase::DoCancel() {
|
| url_fetcher_.reset(NULL);
|
| - RunCallbackOnPrematureFailure(GDATA_CANCELLED);
|
| + RunCallbackOnPrematureFailure(DRIVE_CANCELLED);
|
| }
|
|
|
| -GDataErrorCode UrlFetchOperationBase::GetErrorCode(
|
| +DriveErrorCode UrlFetchOperationBase::GetErrorCode(
|
| const URLFetcher* source) const {
|
| - GDataErrorCode code = static_cast<GDataErrorCode>(source->GetResponseCode());
|
| + DriveErrorCode code = static_cast<DriveErrorCode>(source->GetResponseCode());
|
| if (code == HTTP_SUCCESS && !source->GetStatus().is_success()) {
|
| // If the HTTP response code is SUCCESS yet the URL request failed, it is
|
| // likely that the failure is due to loss of connection.
|
| - code = GDATA_NO_CONNECTION;
|
| + code = DRIVE_NO_CONNECTION;
|
| }
|
| return code;
|
| }
|
| @@ -273,7 +273,7 @@ void UrlFetchOperationBase::OnProcessURLFetchResultsComplete(bool result) {
|
| }
|
|
|
| void UrlFetchOperationBase::OnURLFetchComplete(const URLFetcher* source) {
|
| - GDataErrorCode code = GetErrorCode(source);
|
| + DriveErrorCode code = GetErrorCode(source);
|
| DVLOG(1) << "Response headers:\n" << GetResponseHeadersAsString(source);
|
|
|
| if (code == HTTP_UNAUTHORIZED) {
|
| @@ -299,7 +299,7 @@ void UrlFetchOperationBase::NotifyStartToOperationRegistry() {
|
| NotifyStart();
|
| }
|
|
|
| -void UrlFetchOperationBase::OnAuthFailed(GDataErrorCode code) {
|
| +void UrlFetchOperationBase::OnAuthFailed(DriveErrorCode code) {
|
| RunCallbackOnPrematureFailure(code);
|
|
|
| // Notify authentication failed.
|
| @@ -349,14 +349,14 @@ EntryActionOperation::~EntryActionOperation() {}
|
|
|
| void EntryActionOperation::ProcessURLFetchResults(const URLFetcher* source) {
|
| if (!callback_.is_null()) {
|
| - GDataErrorCode code = GetErrorCode(source);
|
| + DriveErrorCode code = GetErrorCode(source);
|
| callback_.Run(code, document_url_);
|
| }
|
| const bool success = true;
|
| OnProcessURLFetchResultsComplete(success);
|
| }
|
|
|
| -void EntryActionOperation::RunCallbackOnPrematureFailure(GDataErrorCode code) {
|
| +void EntryActionOperation::RunCallbackOnPrematureFailure(DriveErrorCode code) {
|
| if (!callback_.is_null())
|
| callback_.Run(code, document_url_);
|
| }
|
| @@ -376,7 +376,7 @@ void GetDataOperation::ProcessURLFetchResults(const URLFetcher* source) {
|
| std::string data;
|
| source->GetResponseAsString(&data);
|
| scoped_ptr<base::Value> root_value;
|
| - GDataErrorCode fetch_error_code = GetErrorCode(source);
|
| + DriveErrorCode fetch_error_code = GetErrorCode(source);
|
|
|
| switch (fetch_error_code) {
|
| case HTTP_SUCCESS:
|
| @@ -392,14 +392,14 @@ void GetDataOperation::ProcessURLFetchResults(const URLFetcher* source) {
|
| }
|
|
|
| void GetDataOperation::RunCallbackOnPrematureFailure(
|
| - GDataErrorCode fetch_error_code) {
|
| + DriveErrorCode fetch_error_code) {
|
| if (!callback_.is_null()) {
|
| scoped_ptr<base::Value> root_value;
|
| callback_.Run(fetch_error_code, root_value.Pass());
|
| }
|
| }
|
|
|
| -void GetDataOperation::ParseResponse(GDataErrorCode fetch_error_code,
|
| +void GetDataOperation::ParseResponse(DriveErrorCode fetch_error_code,
|
| const std::string& data) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| @@ -420,13 +420,13 @@ void GetDataOperation::ParseResponse(GDataErrorCode fetch_error_code,
|
| }
|
|
|
| void GetDataOperation::OnDataParsed(
|
| - gdata::GDataErrorCode fetch_error_code,
|
| + gdata::DriveErrorCode fetch_error_code,
|
| scoped_ptr<base::Value>* value) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| bool success = true;
|
| if (!value->get()) {
|
| - fetch_error_code = gdata::GDATA_PARSE_ERROR;
|
| + fetch_error_code = gdata::DRIVE_PARSE_ERROR;
|
| success = false;
|
| }
|
|
|
| @@ -440,7 +440,7 @@ void GetDataOperation::OnDataParsed(
|
| // |value| will be deleted after return because it is base::Owned()'d.
|
| }
|
|
|
| -void GetDataOperation::RunCallback(GDataErrorCode fetch_error_code,
|
| +void GetDataOperation::RunCallback(DriveErrorCode fetch_error_code,
|
| scoped_ptr<base::Value> value) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| if (!callback_.is_null())
|
|
|