| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 11 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
| 12 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 12 #include "chrome/browser/profiles/profile_info_cache.h" | 13 #include "chrome/browser/profiles/profile_info_cache.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/browser/profiles/profile_metrics.h" | 15 #include "chrome/browser/profiles/profile_metrics.h" |
| 15 #include "chrome/browser/profiles/profile_window.h" | 16 #include "chrome/browser/profiles/profile_window.h" |
| 16 #include "chrome/browser/signin/local_auth.h" | 17 #include "chrome/browser/signin/local_auth.h" |
| 17 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 18 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 18 #include "chrome/browser/signin/signin_manager_factory.h" | 19 #include "chrome/browser/signin/signin_manager_factory.h" |
| 19 #include "chrome/browser/web_data_service_factory.h" | 20 #include "chrome/browser/web_data_service_factory.h" |
| 20 #include "chrome/common/channel_info.h" | 21 #include "chrome/common/channel_info.h" |
| 21 #include "components/content_settings/core/browser/cookie_settings.h" | 22 #include "components/content_settings/core/browser/cookie_settings.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 return base::Time::FromTimeT( | 200 return base::Time::FromTimeT( |
| 200 g_browser_process->metrics_service()->GetInstallDate()); | 201 g_browser_process->metrics_service()->GetInstallDate()); |
| 201 } | 202 } |
| 202 | 203 |
| 203 bool ChromeSigninClient::AreSigninCookiesAllowed() { | 204 bool ChromeSigninClient::AreSigninCookiesAllowed() { |
| 204 return ProfileAllowsSigninCookies(profile_); | 205 return ProfileAllowsSigninCookies(profile_); |
| 205 } | 206 } |
| 206 | 207 |
| 207 void ChromeSigninClient::AddContentSettingsObserver( | 208 void ChromeSigninClient::AddContentSettingsObserver( |
| 208 content_settings::Observer* observer) { | 209 content_settings::Observer* observer) { |
| 209 profile_->GetHostContentSettingsMap()->AddObserver(observer); | 210 HostContentSettingsMapFactory::GetForProfile(profile_) |
| 211 ->AddObserver(observer); |
| 210 } | 212 } |
| 211 | 213 |
| 212 void ChromeSigninClient::RemoveContentSettingsObserver( | 214 void ChromeSigninClient::RemoveContentSettingsObserver( |
| 213 content_settings::Observer* observer) { | 215 content_settings::Observer* observer) { |
| 214 profile_->GetHostContentSettingsMap()->RemoveObserver(observer); | 216 HostContentSettingsMapFactory::GetForProfile(profile_) |
| 217 ->RemoveObserver(observer); |
| 215 } | 218 } |
| 216 | 219 |
| 217 scoped_ptr<SigninClient::CookieChangedSubscription> | 220 scoped_ptr<SigninClient::CookieChangedSubscription> |
| 218 ChromeSigninClient::AddCookieChangedCallback( | 221 ChromeSigninClient::AddCookieChangedCallback( |
| 219 const GURL& url, | 222 const GURL& url, |
| 220 const std::string& name, | 223 const std::string& name, |
| 221 const net::CookieStore::CookieChangedCallback& callback) { | 224 const net::CookieStore::CookieChangedCallback& callback) { |
| 222 scoped_refptr<net::URLRequestContextGetter> context_getter = | 225 scoped_refptr<net::URLRequestContextGetter> context_getter = |
| 223 profile_->GetRequestContext(); | 226 profile_->GetRequestContext(); |
| 224 DCHECK(context_getter.get()); | 227 DCHECK(context_getter.get()); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 ProfileOAuth2TokenService* token_service = | 374 ProfileOAuth2TokenService* token_service = |
| 372 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | 375 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
| 373 OAuth2TokenService::ScopeSet scopes; | 376 OAuth2TokenService::ScopeSet scopes; |
| 374 scopes.insert(GaiaConstants::kGoogleUserInfoEmail); | 377 scopes.insert(GaiaConstants::kGoogleUserInfoEmail); |
| 375 oauth_request_ = token_service->StartRequest(account_id, scopes, this); | 378 oauth_request_ = token_service->StartRequest(account_id, scopes, this); |
| 376 } | 379 } |
| 377 } | 380 } |
| 378 } | 381 } |
| 379 #endif | 382 #endif |
| 380 } | 383 } |
| OLD | NEW |