Chromium Code Reviews| 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/gdata/gdata.h" | 5 #include "chrome/browser/chromeos/gdata/gdata.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1083 auth_token_.clear(); | 1083 auth_token_.clear(); |
| 1084 if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) { | 1084 if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) { |
| 1085 refresh_token_ = | 1085 refresh_token_ = |
| 1086 profile_->GetTokenService()->GetOAuth2LoginRefreshToken(); | 1086 profile_->GetTokenService()->GetOAuth2LoginRefreshToken(); |
| 1087 } else { | 1087 } else { |
| 1088 refresh_token_.clear(); | 1088 refresh_token_.clear(); |
| 1089 } | 1089 } |
| 1090 FOR_EACH_OBSERVER(Observer, observers_, OnOAuth2RefreshTokenChanged()); | 1090 FOR_EACH_OBSERVER(Observer, observers_, OnOAuth2RefreshTokenChanged()); |
| 1091 } | 1091 } |
| 1092 | 1092 |
| 1093 //========================= DocumentsServiceInterface ========================== | |
| 1094 | |
| 1095 DocumentsServiceInterface::DocumentsServiceInterface() { | |
|
Ben Chan
2012/03/08 02:01:19
this can be removed.
Greg Spencer (Chromium)
2012/03/08 19:06:35
Done.
| |
| 1096 } | |
| 1097 | |
| 1098 DocumentsServiceInterface::~DocumentsServiceInterface() { | |
| 1099 } | |
| 1100 | |
| 1093 //=============================== DocumentsService ============================= | 1101 //=============================== DocumentsService ============================= |
| 1094 | 1102 |
| 1095 DocumentsService::DocumentsService() | 1103 DocumentsService::DocumentsService() |
| 1096 : profile_(NULL), | 1104 : profile_(NULL), |
| 1097 gdata_auth_service_(new GDataAuthService()), | 1105 gdata_auth_service_(new GDataAuthService()), |
| 1098 operation_registry_(new GDataOperationRegistry), | 1106 operation_registry_(new GDataOperationRegistry), |
| 1099 weak_ptr_factory_(this), | 1107 weak_ptr_factory_(this), |
| 1100 // The weak pointers is used to post tasks to UI thread. | 1108 // The weak pointers is used to post tasks to UI thread. |
| 1101 weak_ptr_bound_to_ui_thread_(weak_ptr_factory_.GetWeakPtr()) { | 1109 weak_ptr_bound_to_ui_thread_(weak_ptr_factory_.GetWeakPtr()) { |
| 1102 } | 1110 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1246 void DocumentsService::RetryOperation(GDataOperationInterface* operation) { | 1254 void DocumentsService::RetryOperation(GDataOperationInterface* operation) { |
| 1247 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1255 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1248 | 1256 |
| 1249 gdata_auth_service_->ClearOAuth2Token(); | 1257 gdata_auth_service_->ClearOAuth2Token(); |
| 1250 // User authentication might have expired - rerun the request to force | 1258 // User authentication might have expired - rerun the request to force |
| 1251 // auth token refresh. | 1259 // auth token refresh. |
| 1252 StartOperation(operation); | 1260 StartOperation(operation); |
| 1253 } | 1261 } |
| 1254 | 1262 |
| 1255 } // namespace gdata | 1263 } // namespace gdata |
| OLD | NEW |