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/signin/chrome_signin_client.h" | 5 #include "chrome/browser/signin/chrome_signin_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
8 | 9 |
9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 15 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
15 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 16 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
16 #include "chrome/browser/profiles/profile_info_cache.h" | 17 #include "chrome/browser/profiles/profile_info_cache.h" |
17 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 scoped_ptr<SigninClient::CookieChangedSubscription> | 224 scoped_ptr<SigninClient::CookieChangedSubscription> |
224 ChromeSigninClient::AddCookieChangedCallback( | 225 ChromeSigninClient::AddCookieChangedCallback( |
225 const GURL& url, | 226 const GURL& url, |
226 const std::string& name, | 227 const std::string& name, |
227 const net::CookieStore::CookieChangedCallback& callback) { | 228 const net::CookieStore::CookieChangedCallback& callback) { |
228 scoped_refptr<net::URLRequestContextGetter> context_getter = | 229 scoped_refptr<net::URLRequestContextGetter> context_getter = |
229 profile_->GetRequestContext(); | 230 profile_->GetRequestContext(); |
230 DCHECK(context_getter.get()); | 231 DCHECK(context_getter.get()); |
231 scoped_ptr<SigninCookieChangedSubscription> subscription( | 232 scoped_ptr<SigninCookieChangedSubscription> subscription( |
232 new SigninCookieChangedSubscription(context_getter, url, name, callback)); | 233 new SigninCookieChangedSubscription(context_getter, url, name, callback)); |
233 return subscription.Pass(); | 234 return std::move(subscription); |
234 } | 235 } |
235 | 236 |
236 void ChromeSigninClient::OnSignedIn(const std::string& account_id, | 237 void ChromeSigninClient::OnSignedIn(const std::string& account_id, |
237 const std::string& gaia_id, | 238 const std::string& gaia_id, |
238 const std::string& username, | 239 const std::string& username, |
239 const std::string& password) { | 240 const std::string& password) { |
240 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 241 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
241 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); | 242 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
242 size_t index = cache.GetIndexOfProfileWithPath(profile_->GetPath()); | 243 size_t index = cache.GetIndexOfProfileWithPath(profile_->GetPath()); |
243 if (index != std::string::npos) { | 244 if (index != std::string::npos) { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 ProfileOAuth2TokenService* token_service = | 374 ProfileOAuth2TokenService* token_service = |
374 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | 375 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
375 OAuth2TokenService::ScopeSet scopes; | 376 OAuth2TokenService::ScopeSet scopes; |
376 scopes.insert(GaiaConstants::kGoogleUserInfoEmail); | 377 scopes.insert(GaiaConstants::kGoogleUserInfoEmail); |
377 oauth_request_ = token_service->StartRequest(account_id, scopes, this); | 378 oauth_request_ = token_service->StartRequest(account_id, scopes, this); |
378 } | 379 } |
379 } | 380 } |
380 } | 381 } |
381 #endif | 382 #endif |
382 } | 383 } |
OLD | NEW |