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

Unified Diff: chrome/browser/ui/autofill/chrome_autofill_client.cc

Issue 873583007: Add OAuth2 token to RealPanRequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ) Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/autofill/chrome_autofill_client.cc
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc
index 47b821982e33ad2042643c681b2a88a895fa6a4f..dbc94d9b731b8fe9253d2dc84632219082f4f709 100644
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -10,6 +10,9 @@
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/signin/profile_identity_provider.h"
+#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
#include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h"
#include "chrome/browser/ui/autofill/card_unmask_prompt_view.h"
@@ -33,6 +36,7 @@
#include "chrome/browser/android/chromium_application.h"
#include "chrome/browser/ui/android/autofill/autofill_logger_android.h"
#else
+#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "components/ui/zoom/zoom_controller.h"
#endif
@@ -99,6 +103,23 @@ PrefService* ChromeAutofillClient::GetPrefs() {
->GetPrefs();
}
+IdentityProvider* ChromeAutofillClient::GetIdentityProvider() {
+ if (!identity_provider_) {
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents()->GetBrowserContext());
+ LoginUIService* login_service = nullptr;
+#if !defined(OS_ANDROID)
+ login_service = LoginUIServiceFactory::GetForProfile(profile);
+#endif
+ identity_provider_.reset(new ProfileIdentityProvider(
+ SigninManagerFactory::GetForProfile(profile),
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
+ login_service));
+ }
+
+ return identity_provider_.get();
+}
+
void ChromeAutofillClient::ShowAutofillSettings() {
#if defined(OS_ANDROID)
chrome::android::ChromiumApplication::ShowAutofillSettings();
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.h ('k') | components/autofill/core/browser/autofill_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698