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

Unified Diff: chrome/browser/extensions/app_notify_channel_setup.cc

Issue 11618024: [signin] Support for CrOS and OAuth2AccessTokenConsumer services. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: oauth_access_token_ is now correctly set 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
Index: chrome/browser/extensions/app_notify_channel_setup.cc
diff --git a/chrome/browser/extensions/app_notify_channel_setup.cc b/chrome/browser/extensions/app_notify_channel_setup.cc
index 19b06b87450606de8902b01daf2981dccc6b4452..dfeaa09adab7c65b3555ad67a4a9fdb746ba04c2 100644
--- a/chrome/browser/extensions/app_notify_channel_setup.cc
+++ b/chrome/browser/extensions/app_notify_channel_setup.cc
@@ -16,6 +16,8 @@
#include "base/stringprintf.h"
#include "chrome/browser/prefs/pref_service.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"
@@ -118,10 +120,31 @@ void AppNotifyChannelSetup::OnGetTokenSuccess(
const std::string& access_token,
const base::Time& expiration_time) {
oauth2_access_token_ = access_token;
+
+ // Let SigninInternals know about the token fetch.
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(profile_);
+ // TODO(vishwath): This can be removed when refactoring this to use
+ // OAuth2TokenService instead.
+ AboutSigninInternalsFactory::GetForProfile(profile_)->
+ NotifyTokenReceivedSuccess(
+ signin_internals_util::kAppNotifyChannelSetupToken,
+ access_token,
+ true);
+
EndGetAccessToken(true);
}
void AppNotifyChannelSetup::OnGetTokenFailure(
const GoogleServiceAuthError& error) {
+ // Let SigninInternals know about the failed token fetch.
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(profile_);
+ // TODO(vishwath): This can be removed when refactoring this to use
+ // OAuth2TokenService instead.
+ AboutSigninInternalsFactory::GetForProfile(profile_)->
+ NotifyTokenReceivedFailure(
+ signin_internals_util::kAppNotifyChannelSetupToken, error.ToString());
+
EndGetAccessToken(false);
}

Powered by Google App Engine
This is Rietveld 408576698