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& document_url, |
| 962 const GURL& plugin_url, |
| 963 content::ResourceContext* context) { |
| 964 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 965 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
| 966 return io_data->GetCookieSettings()->IsReadingCookieAllowed(document_url, |
| 967 plugin_url); |
| 968 } |
| 969 |
| 970 bool ChromeContentBrowserClient::AllowPluginLocalDataSessionOnly( |
| 971 const GURL& url, |
| 972 content::ResourceContext* context) { |
| 973 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 974 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
| 975 return io_data->GetCookieSettings()->IsCookieSessionOnly(url); |
| 976 } |
| 977 |
960 bool ChromeContentBrowserClient::AllowSaveLocalState( | 978 bool ChromeContentBrowserClient::AllowSaveLocalState( |
961 content::ResourceContext* context) { | 979 content::ResourceContext* context) { |
962 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 980 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
963 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); | 981 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
964 CookieSettings* cookie_settings = io_data->GetCookieSettings(); | 982 CookieSettings* cookie_settings = io_data->GetCookieSettings(); |
965 ContentSetting setting = cookie_settings->GetDefaultCookieSetting(NULL); | 983 ContentSetting setting = cookie_settings->GetDefaultCookieSetting(NULL); |
966 | 984 |
967 // TODO(bauerb): Should we also disallow local state if the default is BLOCK? | 985 // TODO(bauerb): Should we also disallow local state if the default is BLOCK? |
968 // Could we even support per-origin settings? | 986 // Could we even support per-origin settings? |
969 return setting != CONTENT_SETTING_SESSION_ONLY; | 987 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; | 1681 io_thread_application_locale_ = locale; |
1664 } | 1682 } |
1665 | 1683 |
1666 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1684 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
1667 const std::string& locale) { | 1685 const std::string& locale) { |
1668 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1686 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
1669 io_thread_application_locale_ = locale; | 1687 io_thread_application_locale_ = locale; |
1670 } | 1688 } |
1671 | 1689 |
1672 } // namespace chrome | 1690 } // namespace chrome |
OLD | NEW |