OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/signin/signin_client_impl.h" | 5 #include "ios/chrome/browser/signin/signin_client_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
| 9 #include <utility> |
| 10 |
9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
10 #include "base/guid.h" | 12 #include "base/guid.h" |
11 #include "base/logging.h" | 13 #include "base/logging.h" |
12 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
13 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
14 #include "components/content_settings/core/browser/cookie_settings.h" | 16 #include "components/content_settings/core/browser/cookie_settings.h" |
15 #include "components/keyed_service/core/service_access_type.h" | 17 #include "components/keyed_service/core/service_access_type.h" |
16 #include "components/metrics/metrics_service.h" | 18 #include "components/metrics/metrics_service.h" |
17 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 19 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
18 #include "components/signin/core/browser/signin_cookie_changed_subscription.h" | 20 #include "components/signin/core/browser/signin_cookie_changed_subscription.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 scoped_ptr<SigninClient::CookieChangedSubscription> | 137 scoped_ptr<SigninClient::CookieChangedSubscription> |
136 SigninClientImpl::AddCookieChangedCallback( | 138 SigninClientImpl::AddCookieChangedCallback( |
137 const GURL& url, | 139 const GURL& url, |
138 const std::string& name, | 140 const std::string& name, |
139 const net::CookieStore::CookieChangedCallback& callback) { | 141 const net::CookieStore::CookieChangedCallback& callback) { |
140 scoped_refptr<net::URLRequestContextGetter> context_getter = | 142 scoped_refptr<net::URLRequestContextGetter> context_getter = |
141 browser_state_->GetRequestContext(); | 143 browser_state_->GetRequestContext(); |
142 DCHECK(context_getter.get()); | 144 DCHECK(context_getter.get()); |
143 scoped_ptr<SigninCookieChangedSubscription> subscription( | 145 scoped_ptr<SigninCookieChangedSubscription> subscription( |
144 new SigninCookieChangedSubscription(context_getter, url, name, callback)); | 146 new SigninCookieChangedSubscription(context_getter, url, name, callback)); |
145 return subscription.Pass(); | 147 return std::move(subscription); |
146 } | 148 } |
147 | 149 |
148 void SigninClientImpl::OnSignedIn(const std::string& account_id, | 150 void SigninClientImpl::OnSignedIn(const std::string& account_id, |
149 const std::string& gaia_id, | 151 const std::string& gaia_id, |
150 const std::string& username, | 152 const std::string& username, |
151 const std::string& password) { | 153 const std::string& password) { |
152 ios::ChromeBrowserStateManager* browser_state_manager = | 154 ios::ChromeBrowserStateManager* browser_state_manager = |
153 GetApplicationContext()->GetChromeBrowserStateManager(); | 155 GetApplicationContext()->GetChromeBrowserStateManager(); |
154 BrowserStateInfoCache* cache = | 156 BrowserStateInfoCache* cache = |
155 browser_state_manager->GetBrowserStateInfoCache(); | 157 browser_state_manager->GetBrowserStateInfoCache(); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 callback.Run(); | 231 callback.Run(); |
230 } | 232 } |
231 } | 233 } |
232 | 234 |
233 GaiaAuthFetcher* SigninClientImpl::CreateGaiaAuthFetcher( | 235 GaiaAuthFetcher* SigninClientImpl::CreateGaiaAuthFetcher( |
234 GaiaAuthConsumer* consumer, | 236 GaiaAuthConsumer* consumer, |
235 const std::string& source, | 237 const std::string& source, |
236 net::URLRequestContextGetter* getter) { | 238 net::URLRequestContextGetter* getter) { |
237 return new GaiaAuthFetcherIOS(consumer, source, getter, browser_state_); | 239 return new GaiaAuthFetcherIOS(consumer, source, getter, browser_state_); |
238 } | 240 } |
OLD | NEW |