| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 45 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
| 46 #include "chrome/common/chrome_notification_types.h" | 46 #include "chrome/common/chrome_notification_types.h" |
| 47 #include "chrome/common/chrome_switches.h" | 47 #include "chrome/common/chrome_switches.h" |
| 48 #include "chrome/common/pref_names.h" | 48 #include "chrome/common/pref_names.h" |
| 49 #include "chrome/common/url_constants.h" | 49 #include "chrome/common/url_constants.h" |
| 50 #include "content/public/browser/browser_thread.h" | 50 #include "content/public/browser/browser_thread.h" |
| 51 #include "content/public/browser/host_zoom_map.h" | 51 #include "content/public/browser/host_zoom_map.h" |
| 52 #include "content/public/browser/notification_service.h" | 52 #include "content/public/browser/notification_service.h" |
| 53 #include "content/public/browser/resource_context.h" | 53 #include "content/public/browser/resource_context.h" |
| 54 #include "net/base/server_bound_cert_service.h" | 54 #include "net/base/server_bound_cert_service.h" |
| 55 #include "net/cookies/canonical_cookie.h" |
| 56 #include "net/cookies/cookie_monster.h" |
| 55 #include "net/http/http_transaction_factory.h" | 57 #include "net/http/http_transaction_factory.h" |
| 56 #include "net/http/http_util.h" | 58 #include "net/http/http_util.h" |
| 57 #include "net/proxy/proxy_config_service_fixed.h" | 59 #include "net/proxy/proxy_config_service_fixed.h" |
| 58 #include "net/proxy/proxy_script_fetcher_impl.h" | 60 #include "net/proxy/proxy_script_fetcher_impl.h" |
| 59 #include "net/proxy/proxy_service.h" | 61 #include "net/proxy/proxy_service.h" |
| 60 #include "net/url_request/url_request.h" | 62 #include "net/url_request/url_request.h" |
| 61 | 63 |
| 62 #if defined(OS_CHROMEOS) | 64 #if defined(OS_CHROMEOS) |
| 63 #include "chrome/browser/chromeos/cros_settings.h" | 65 #include "chrome/browser/chromeos/cros_settings.h" |
| 64 #include "chrome/browser/chromeos/cros_settings_names.h" | 66 #include "chrome/browser/chromeos/cros_settings_names.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 79 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { | 81 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { |
| 80 public: | 82 public: |
| 81 explicit ChromeCookieMonsterDelegate( | 83 explicit ChromeCookieMonsterDelegate( |
| 82 const base::Callback<Profile*(void)>& profile_getter) | 84 const base::Callback<Profile*(void)>& profile_getter) |
| 83 : profile_getter_(profile_getter) { | 85 : profile_getter_(profile_getter) { |
| 84 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 86 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 85 } | 87 } |
| 86 | 88 |
| 87 // net::CookieMonster::Delegate implementation. | 89 // net::CookieMonster::Delegate implementation. |
| 88 virtual void OnCookieChanged( | 90 virtual void OnCookieChanged( |
| 89 const net::CookieMonster::CanonicalCookie& cookie, | 91 const net::CanonicalCookie& cookie, |
| 90 bool removed, | 92 bool removed, |
| 91 net::CookieMonster::Delegate::ChangeCause cause) { | 93 net::CookieMonster::Delegate::ChangeCause cause) { |
| 92 BrowserThread::PostTask( | 94 BrowserThread::PostTask( |
| 93 BrowserThread::UI, FROM_HERE, | 95 BrowserThread::UI, FROM_HERE, |
| 94 base::Bind(&ChromeCookieMonsterDelegate::OnCookieChangedAsyncHelper, | 96 base::Bind(&ChromeCookieMonsterDelegate::OnCookieChangedAsyncHelper, |
| 95 this, cookie, removed, cause)); | 97 this, cookie, removed, cause)); |
| 96 } | 98 } |
| 97 | 99 |
| 98 private: | 100 private: |
| 99 virtual ~ChromeCookieMonsterDelegate() {} | 101 virtual ~ChromeCookieMonsterDelegate() {} |
| 100 | 102 |
| 101 void OnCookieChangedAsyncHelper( | 103 void OnCookieChangedAsyncHelper( |
| 102 const net::CookieMonster::CanonicalCookie& cookie, | 104 const net::CanonicalCookie& cookie, |
| 103 bool removed, | 105 bool removed, |
| 104 net::CookieMonster::Delegate::ChangeCause cause) { | 106 net::CookieMonster::Delegate::ChangeCause cause) { |
| 105 Profile* profile = profile_getter_.Run(); | 107 Profile* profile = profile_getter_.Run(); |
| 106 if (profile) { | 108 if (profile) { |
| 107 ChromeCookieDetails cookie_details(&cookie, removed, cause); | 109 ChromeCookieDetails cookie_details(&cookie, removed, cause); |
| 108 content::NotificationService::current()->Notify( | 110 content::NotificationService::current()->Notify( |
| 109 chrome::NOTIFICATION_COOKIE_CHANGED, | 111 chrome::NOTIFICATION_COOKIE_CHANGED, |
| 110 content::Source<Profile>(profile), | 112 content::Source<Profile>(profile), |
| 111 content::Details<ChromeCookieDetails>(&cookie_details)); | 113 content::Details<ChromeCookieDetails>(&cookie_details)); |
| 112 } | 114 } |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 } | 602 } |
| 601 | 603 |
| 602 void ProfileIOData::set_server_bound_cert_service( | 604 void ProfileIOData::set_server_bound_cert_service( |
| 603 net::ServerBoundCertService* server_bound_cert_service) const { | 605 net::ServerBoundCertService* server_bound_cert_service) const { |
| 604 server_bound_cert_service_.reset(server_bound_cert_service); | 606 server_bound_cert_service_.reset(server_bound_cert_service); |
| 605 } | 607 } |
| 606 | 608 |
| 607 void ProfileIOData::DestroyResourceContext() { | 609 void ProfileIOData::DestroyResourceContext() { |
| 608 resource_context_.reset(); | 610 resource_context_.reset(); |
| 609 } | 611 } |
| OLD | NEW |