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

Unified Diff: chrome/browser/chrome_to_mobile_service.cc

Issue 11618024: [signin] Support for CrOS and OAuth2AccessTokenConsumer services. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor fixes 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/online_attempt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_to_mobile_service.cc
diff --git a/chrome/browser/chrome_to_mobile_service.cc b/chrome/browser/chrome_to_mobile_service.cc
index 744153b54edd91f8405f29897b87adbf6e35cb3a..552bf25c601d96e9284a67ef30700ccf2613f9f7 100644
--- a/chrome/browser/chrome_to_mobile_service.cc
+++ b/chrome/browser/chrome_to_mobile_service.cc
@@ -17,6 +17,10 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/printing/cloud_print/cloud_print_url.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/signin/about_signin_internals.h"
+#include "chrome/browser/signin/about_signin_internals_factory.h"
+#include "chrome/browser/signin/signin_manager.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/token_service.h"
#include "chrome/browser/signin/token_service_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
@@ -431,6 +435,16 @@ void ChromeToMobileService::OnGetTokenSuccess(
NOTREACHED();
}
+ // Let SigninInternals know about the token fetch.
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK(profile_);
+ // TODO(vishwath): This can be removed when refactoring this class to use
+ // OAuth2TokenService instead.
+ AboutSigninInternalsFactory::GetForProfile(profile_)->
+ NotifyTokenReceivedSuccess(signin_internals_util::kChromeToMobileToken,
+ access_token,
+ true);
+
while (!task_queue_.empty()) {
// Post all tasks that were queued and waiting on a valid access token.
if (!content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
@@ -459,6 +473,16 @@ void ChromeToMobileService::OnGetTokenFailure(
auth_retry_timer_.Start(FROM_HERE, delay, this,
&ChromeToMobileService::RequestAccessToken);
+ // Let SigninInternals know about the failed token fetch.
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK(profile_);
+ // TODO(vishwath): This can be removed when refactoring this class to use
+ // OAuth2TokenService instead.
+ AboutSigninInternalsFactory::GetForProfile(profile_)->
+ NotifyTokenReceivedFailure(signin_internals_util::kChromeToMobileToken,
+ error.ToString());
+
+
// Clear the mobile list, which may be (or become) out of date.
ListValue empty;
profile_->GetPrefs()->Set(prefs::kChromeToMobileDeviceList, empty);
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/online_attempt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698