| 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 bool allow = cookie_settings->IsSettingCookieAllowed(url, first_party); | 950 bool allow = cookie_settings->IsSettingCookieAllowed(url, first_party); |
| 951 | 951 |
| 952 BrowserThread::PostTask( | 952 BrowserThread::PostTask( |
| 953 BrowserThread::UI, FROM_HERE, | 953 BrowserThread::UI, FROM_HERE, |
| 954 base::Bind(&TabSpecificContentSettings::CookieChanged, render_process_id, | 954 base::Bind(&TabSpecificContentSettings::CookieChanged, render_process_id, |
| 955 render_view_id, url, first_party, cookie_line, *options, | 955 render_view_id, url, first_party, cookie_line, *options, |
| 956 !allow)); | 956 !allow)); |
| 957 return allow; | 957 return allow; |
| 958 } | 958 } |
| 959 | 959 |
| 960 bool ChromeContentBrowserClient::AllowPluginLocalDataAccess( |
| 961 const GURL& site_url, |
| 962 const GURL& plugin_url, |
| 963 content::ResourceContext* context) { |
| 964 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
| 965 return io_data->GetCookieSettings()->IsReadingCookieAllowed(site_url, |
| 966 plugin_url); |
| 967 } |
| 968 |
| 969 bool ChromeContentBrowserClient::AllowPluginLocalDataSessionOnly( |
| 970 const GURL& url, |
| 971 content::ResourceContext* context) { |
| 972 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
| 973 return io_data->GetCookieSettings()->IsCookieSessionOnly(url); |
| 974 } |
| 975 |
| 960 bool ChromeContentBrowserClient::AllowSaveLocalState( | 976 bool ChromeContentBrowserClient::AllowSaveLocalState( |
| 961 content::ResourceContext* context) { | 977 content::ResourceContext* context) { |
| 962 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 978 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 963 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); | 979 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
| 964 CookieSettings* cookie_settings = io_data->GetCookieSettings(); | 980 CookieSettings* cookie_settings = io_data->GetCookieSettings(); |
| 965 ContentSetting setting = cookie_settings->GetDefaultCookieSetting(NULL); | 981 ContentSetting setting = cookie_settings->GetDefaultCookieSetting(NULL); |
| 966 | 982 |
| 967 // TODO(bauerb): Should we also disallow local state if the default is BLOCK? | 983 // TODO(bauerb): Should we also disallow local state if the default is BLOCK? |
| 968 // Could we even support per-origin settings? | 984 // Could we even support per-origin settings? |
| 969 return setting != CONTENT_SETTING_SESSION_ONLY; | 985 return setting != CONTENT_SETTING_SESSION_ONLY; |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 io_thread_application_locale_ = locale; | 1679 io_thread_application_locale_ = locale; |
| 1664 } | 1680 } |
| 1665 | 1681 |
| 1666 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1682 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
| 1667 const std::string& locale) { | 1683 const std::string& locale) { |
| 1668 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1684 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 1669 io_thread_application_locale_ = locale; | 1685 io_thread_application_locale_ = locale; |
| 1670 } | 1686 } |
| 1671 | 1687 |
| 1672 } // namespace chrome | 1688 } // namespace chrome |
| OLD | NEW |