OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/content/browser/wallet/wallet_signin_helper.h" | 5 #include "components/autofill/content/browser/wallet/wallet_signin_helper.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 DCHECK(delegate_); | 96 DCHECK(delegate_); |
97 } | 97 } |
98 | 98 |
99 WalletSigninHelper::~WalletSigninHelper() { | 99 WalletSigninHelper::~WalletSigninHelper() { |
100 } | 100 } |
101 | 101 |
102 void WalletSigninHelper::StartPassiveSignin(size_t user_index) { | 102 void WalletSigninHelper::StartPassiveSignin(size_t user_index) { |
103 DCHECK(!url_fetcher_); | 103 DCHECK(!url_fetcher_); |
104 | 104 |
105 const GURL& url = wallet::GetPassiveAuthUrl(user_index); | 105 const GURL& url = wallet::GetPassiveAuthUrl(user_index); |
106 url_fetcher_.reset(net::URLFetcher::Create( | 106 url_fetcher_ = net::URLFetcher::Create(0, url, net::URLFetcher::GET, this); |
107 0, url, net::URLFetcher::GET, this)); | |
108 url_fetcher_->SetRequestContext(getter_); | 107 url_fetcher_->SetRequestContext(getter_); |
109 url_fetcher_->Start(); | 108 url_fetcher_->Start(); |
110 } | 109 } |
111 | 110 |
112 void WalletSigninHelper::StartWalletCookieValueFetch() { | 111 void WalletSigninHelper::StartWalletCookieValueFetch() { |
113 scoped_refptr<net::URLRequestContextGetter> request_context(getter_); | 112 scoped_refptr<net::URLRequestContextGetter> request_context(getter_); |
114 if (!request_context.get()) { | 113 if (!request_context.get()) { |
115 ReturnWalletCookieValue(std::string()); | 114 ReturnWalletCookieValue(std::string()); |
116 return; | 115 return; |
117 } | 116 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 165 |
167 void WalletSigninHelper::ReturnWalletCookieValue( | 166 void WalletSigninHelper::ReturnWalletCookieValue( |
168 const std::string& cookie_value) { | 167 const std::string& cookie_value) { |
169 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 168 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
170 | 169 |
171 delegate_->OnDidFetchWalletCookieValue(cookie_value); | 170 delegate_->OnDidFetchWalletCookieValue(cookie_value); |
172 } | 171 } |
173 | 172 |
174 } // namespace wallet | 173 } // namespace wallet |
175 } // namespace autofill | 174 } // namespace autofill |
OLD | NEW |