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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata.cc

Issue 9582037: Make document service an interface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Review changes Created 8 years, 9 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 (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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698