OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/auto_login_infobar_delegate.h" | 5 #include "chrome/browser/ui/auto_login_infobar_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 : content::WebContentsObserver(web_contents), | 80 : content::WebContentsObserver(web_contents), |
81 args_(args) { | 81 args_(args) { |
82 Profile* profile = | 82 Profile* profile = |
83 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 83 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
84 ProfileOAuth2TokenService* token_service = | 84 ProfileOAuth2TokenService* token_service = |
85 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); | 85 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); |
86 SigninManagerBase* signin_manager = | 86 SigninManagerBase* signin_manager = |
87 SigninManagerFactory::GetInstance()->GetForProfile(profile); | 87 SigninManagerFactory::GetInstance()->GetForProfile(profile); |
88 ubertoken_fetcher_.reset(new UbertokenFetcher(token_service, | 88 ubertoken_fetcher_.reset(new UbertokenFetcher(token_service, |
89 this, | 89 this, |
| 90 GaiaConstants::kChromeSource, |
90 profile->GetRequestContext())); | 91 profile->GetRequestContext())); |
91 ubertoken_fetcher_->StartFetchingToken( | 92 ubertoken_fetcher_->StartFetchingToken( |
92 signin_manager->GetAuthenticatedAccountId()); | 93 signin_manager->GetAuthenticatedAccountId()); |
93 } | 94 } |
94 | 95 |
95 AutoLoginRedirector::~AutoLoginRedirector() { | 96 AutoLoginRedirector::~AutoLoginRedirector() { |
96 } | 97 } |
97 | 98 |
98 void AutoLoginRedirector::WebContentsDestroyed() { | 99 void AutoLoginRedirector::WebContentsDestroyed() { |
99 // The WebContents that started this has been destroyed. The request must be | 100 // The WebContents that started this has been destroyed. The request must be |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 RecordHistogramAction(REJECTED); | 231 RecordHistogramAction(REJECTED); |
231 button_pressed_ = true; | 232 button_pressed_ = true; |
232 return true; | 233 return true; |
233 } | 234 } |
234 | 235 |
235 void AutoLoginInfoBarDelegate::GoogleSignedOut( | 236 void AutoLoginInfoBarDelegate::GoogleSignedOut( |
236 const std::string& account_id, | 237 const std::string& account_id, |
237 const std::string& username) { | 238 const std::string& username) { |
238 infobar()->RemoveSelf(); | 239 infobar()->RemoveSelf(); |
239 } | 240 } |
OLD | NEW |