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

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

Issue 10831122: gdata cleanup: stop passing Profile* around GData operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 4 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 | Annotate | Revision Log
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_auth_service.h" 5 #include "chrome/browser/chromeos/gdata/gdata_auth_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 base::Bind(callback, gdata::HTTP_UNAUTHORIZED, std::string())); 74 base::Bind(callback, gdata::HTTP_UNAUTHORIZED, std::string()));
75 } 75 }
76 } 76 }
77 77
78 void GDataAuthService::StartAuthenticationOnUIThread( 78 void GDataAuthService::StartAuthenticationOnUIThread(
79 GDataOperationRegistry* registry, 79 GDataOperationRegistry* registry,
80 scoped_refptr<base::MessageLoopProxy> relay_proxy, 80 scoped_refptr<base::MessageLoopProxy> relay_proxy,
81 const AuthStatusCallback& callback) { 81 const AuthStatusCallback& callback) {
82 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 82 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
83 // We have refresh token, let's gets authenticated. 83 // We have refresh token, let's gets authenticated.
84 (new AuthOperation(registry, profile_, 84 (new AuthOperation(registry, callback, refresh_token_))->Start();
85 callback, refresh_token_))->Start();
86 } 85 }
87 86
88 void GDataAuthService::OnAuthCompleted( 87 void GDataAuthService::OnAuthCompleted(
89 scoped_refptr<base::MessageLoopProxy> relay_proxy, 88 scoped_refptr<base::MessageLoopProxy> relay_proxy,
90 const AuthStatusCallback& callback, 89 const AuthStatusCallback& callback,
91 GDataErrorCode error, 90 GDataErrorCode error,
92 const std::string& access_token) { 91 const std::string& access_token) {
93 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
94 93
95 if (error == HTTP_SUCCESS) 94 if (error == HTTP_SUCCESS)
(...skipping 27 matching lines...) Expand all
123 if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) { 122 if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) {
124 TokenService* service = TokenServiceFactory::GetForProfile(profile_); 123 TokenService* service = TokenServiceFactory::GetForProfile(profile_);
125 refresh_token_ = service->GetOAuth2LoginRefreshToken(); 124 refresh_token_ = service->GetOAuth2LoginRefreshToken();
126 } else { 125 } else {
127 refresh_token_.clear(); 126 refresh_token_.clear();
128 } 127 }
129 FOR_EACH_OBSERVER(Observer, observers_, OnOAuth2RefreshTokenChanged()); 128 FOR_EACH_OBSERVER(Observer, observers_, OnOAuth2RefreshTokenChanged());
130 } 129 }
131 130
132 } // namespace gdata 131 } // namespace gdata
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/drive_api_operations.cc ('k') | chrome/browser/chromeos/gdata/gdata_contacts_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698