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> | 9 #include <utility> |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 ios::HostContentSettingsMapFactory::GetForBrowserState(browser_state_) | 126 ios::HostContentSettingsMapFactory::GetForBrowserState(browser_state_) |
127 ->AddObserver(observer); | 127 ->AddObserver(observer); |
128 } | 128 } |
129 | 129 |
130 void SigninClientImpl::RemoveContentSettingsObserver( | 130 void SigninClientImpl::RemoveContentSettingsObserver( |
131 content_settings::Observer* observer) { | 131 content_settings::Observer* observer) { |
132 ios::HostContentSettingsMapFactory::GetForBrowserState(browser_state_) | 132 ios::HostContentSettingsMapFactory::GetForBrowserState(browser_state_) |
133 ->RemoveObserver(observer); | 133 ->RemoveObserver(observer); |
134 } | 134 } |
135 | 135 |
136 scoped_ptr<SigninClient::CookieChangedSubscription> | 136 std::unique_ptr<SigninClient::CookieChangedSubscription> |
137 SigninClientImpl::AddCookieChangedCallback( | 137 SigninClientImpl::AddCookieChangedCallback( |
138 const GURL& url, | 138 const GURL& url, |
139 const std::string& name, | 139 const std::string& name, |
140 const net::CookieStore::CookieChangedCallback& callback) { | 140 const net::CookieStore::CookieChangedCallback& callback) { |
141 scoped_refptr<net::URLRequestContextGetter> context_getter = | 141 scoped_refptr<net::URLRequestContextGetter> context_getter = |
142 browser_state_->GetRequestContext(); | 142 browser_state_->GetRequestContext(); |
143 DCHECK(context_getter.get()); | 143 DCHECK(context_getter.get()); |
144 scoped_ptr<SigninCookieChangedSubscription> subscription( | 144 std::unique_ptr<SigninCookieChangedSubscription> subscription( |
145 new SigninCookieChangedSubscription(context_getter, url, name, callback)); | 145 new SigninCookieChangedSubscription(context_getter, url, name, callback)); |
146 return std::move(subscription); | 146 return std::move(subscription); |
147 } | 147 } |
148 | 148 |
149 void SigninClientImpl::OnSignedIn(const std::string& account_id, | 149 void SigninClientImpl::OnSignedIn(const std::string& account_id, |
150 const std::string& gaia_id, | 150 const std::string& gaia_id, |
151 const std::string& username, | 151 const std::string& username, |
152 const std::string& password) { | 152 const std::string& password) { |
153 ios::ChromeBrowserStateManager* browser_state_manager = | 153 ios::ChromeBrowserStateManager* browser_state_manager = |
154 GetApplicationContext()->GetChromeBrowserStateManager(); | 154 GetApplicationContext()->GetChromeBrowserStateManager(); |
(...skipping 14 matching lines...) Expand all Loading... |
169 size_t index = cache->GetIndexOfBrowserStateWithPath( | 169 size_t index = cache->GetIndexOfBrowserStateWithPath( |
170 browser_state_->GetOriginalChromeBrowserState()->GetStatePath()); | 170 browser_state_->GetOriginalChromeBrowserState()->GetStatePath()); |
171 if (index == std::string::npos) | 171 if (index == std::string::npos) |
172 return; | 172 return; |
173 | 173 |
174 cache->SetBrowserStateIsAuthErrorAtIndex( | 174 cache->SetBrowserStateIsAuthErrorAtIndex( |
175 index, signin_error_controller_->HasError()); | 175 index, signin_error_controller_->HasError()); |
176 } | 176 } |
177 | 177 |
178 void SigninClientImpl::OnGetTokenInfoResponse( | 178 void SigninClientImpl::OnGetTokenInfoResponse( |
179 scoped_ptr<base::DictionaryValue> token_info) { | 179 std::unique_ptr<base::DictionaryValue> token_info) { |
180 oauth_request_.reset(); | 180 oauth_request_.reset(); |
181 } | 181 } |
182 | 182 |
183 void SigninClientImpl::OnOAuthError() { | 183 void SigninClientImpl::OnOAuthError() { |
184 // Ignore the failure. It's not essential and we'll try again next time. | 184 // Ignore the failure. It's not essential and we'll try again next time. |
185 oauth_request_.reset(); | 185 oauth_request_.reset(); |
186 } | 186 } |
187 | 187 |
188 void SigninClientImpl::OnNetworkError(int response_code) { | 188 void SigninClientImpl::OnNetworkError(int response_code) { |
189 // Ignore the failure. It's not essential and we'll try again next time. | 189 // Ignore the failure. It's not essential and we'll try again next time. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 callback.Run(); | 230 callback.Run(); |
231 } | 231 } |
232 } | 232 } |
233 | 233 |
234 GaiaAuthFetcher* SigninClientImpl::CreateGaiaAuthFetcher( | 234 GaiaAuthFetcher* SigninClientImpl::CreateGaiaAuthFetcher( |
235 GaiaAuthConsumer* consumer, | 235 GaiaAuthConsumer* consumer, |
236 const std::string& source, | 236 const std::string& source, |
237 net::URLRequestContextGetter* getter) { | 237 net::URLRequestContextGetter* getter) { |
238 return new GaiaAuthFetcherIOS(consumer, source, getter, browser_state_); | 238 return new GaiaAuthFetcherIOS(consumer, source, getter, browser_state_); |
239 } | 239 } |
OLD | NEW |