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

Side by Side Diff: chrome/browser/google_apis/operation_runner.cc

Issue 11316262: google_apis: Move AuthOperation to auth_service.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reorder headers Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/google_apis/operation_runner.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/google_apis/operation_runner.h" 5 #include "chrome/browser/google_apis/operation_runner.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/google_apis/auth_service.h" 8 #include "chrome/browser/google_apis/auth_service.h"
9 #include "chrome/browser/google_apis/base_operations.h" 9 #include "chrome/browser/google_apis/base_operations.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 21 matching lines...) Expand all
32 void OperationRunner::Initialize() { 32 void OperationRunner::Initialize() {
33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
34 auth_service_->Initialize(profile_); 34 auth_service_->Initialize(profile_);
35 } 35 }
36 36
37 void OperationRunner::CancelAll() { 37 void OperationRunner::CancelAll() {
38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
39 operation_registry_->CancelAll(); 39 operation_registry_->CancelAll();
40 } 40 }
41 41
42 void OperationRunner::Authenticate(const AuthStatusCallback& callback) {
43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
44 auth_service_->StartAuthentication(operation_registry_.get(), callback);
45 }
46
47 void OperationRunner::StartOperationWithRetry( 42 void OperationRunner::StartOperationWithRetry(
48 AuthenticatedOperationInterface* operation) { 43 AuthenticatedOperationInterface* operation) {
49 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
50 45
51 // The re-authentication callback will run on UI thread. 46 // The re-authentication callback will run on UI thread.
52 operation->SetReAuthenticateCallback( 47 operation->SetReAuthenticateCallback(
53 base::Bind(&OperationRunner::RetryOperation, 48 base::Bind(&OperationRunner::RetryOperation,
54 weak_ptr_factory_.GetWeakPtr())); 49 weak_ptr_factory_.GetWeakPtr()));
55 StartOperation(operation); 50 StartOperation(operation);
56 } 51 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 AuthenticatedOperationInterface* operation) { 89 AuthenticatedOperationInterface* operation) {
95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
96 91
97 auth_service_->ClearAccessToken(); 92 auth_service_->ClearAccessToken();
98 // User authentication might have expired - rerun the request to force 93 // User authentication might have expired - rerun the request to force
99 // auth token refresh. 94 // auth token refresh.
100 StartOperation(operation); 95 StartOperation(operation);
101 } 96 }
102 97
103 } // namespace google_apis 98 } // namespace google_apis
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/operation_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698