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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 bool allow = cookie_settings->IsSettingCookieAllowed(url, first_party); | 1095 bool allow = cookie_settings->IsSettingCookieAllowed(url, first_party); |
1096 | 1096 |
1097 BrowserThread::PostTask( | 1097 BrowserThread::PostTask( |
1098 BrowserThread::UI, FROM_HERE, | 1098 BrowserThread::UI, FROM_HERE, |
1099 base::Bind(&TabSpecificContentSettings::CookieChanged, render_process_id, | 1099 base::Bind(&TabSpecificContentSettings::CookieChanged, render_process_id, |
1100 render_view_id, url, first_party, cookie_line, *options, | 1100 render_view_id, url, first_party, cookie_line, *options, |
1101 !allow)); | 1101 !allow)); |
1102 return allow; | 1102 return allow; |
1103 } | 1103 } |
1104 | 1104 |
1105 bool ChromeContentBrowserClient::AllowPluginLocalDataAccess( | |
1106 const GURL& document_url, | |
1107 const GURL& plugin_url, | |
1108 content::ResourceContext* context) { | |
1109 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
1110 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); | |
1111 return io_data->GetCookieSettings()->IsReadingCookieAllowed(document_url, | |
1112 plugin_url); | |
1113 } | |
1114 | |
1115 bool ChromeContentBrowserClient::AllowPluginLocalDataSessionOnly( | |
1116 const GURL& url, | |
1117 content::ResourceContext* context) { | |
1118 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
1119 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); | |
1120 return io_data->GetCookieSettings()->IsCookieSessionOnly(url); | |
1121 } | |
1122 | |
1123 bool ChromeContentBrowserClient::AllowSaveLocalState( | 1105 bool ChromeContentBrowserClient::AllowSaveLocalState( |
1124 content::ResourceContext* context) { | 1106 content::ResourceContext* context) { |
1125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
1126 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); | 1108 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
1127 CookieSettings* cookie_settings = io_data->GetCookieSettings(); | 1109 CookieSettings* cookie_settings = io_data->GetCookieSettings(); |
1128 ContentSetting setting = cookie_settings->GetDefaultCookieSetting(NULL); | 1110 ContentSetting setting = cookie_settings->GetDefaultCookieSetting(NULL); |
1129 | 1111 |
1130 // TODO(bauerb): Should we also disallow local state if the default is BLOCK? | 1112 // TODO(bauerb): Should we also disallow local state if the default is BLOCK? |
1131 // Could we even support per-origin settings? | 1113 // Could we even support per-origin settings? |
1132 return setting != CONTENT_SETTING_SESSION_ONLY; | 1114 return setting != CONTENT_SETTING_SESSION_ONLY; |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1927 io_thread_application_locale_ = locale; | 1909 io_thread_application_locale_ = locale; |
1928 } | 1910 } |
1929 | 1911 |
1930 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1912 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
1931 const std::string& locale) { | 1913 const std::string& locale) { |
1932 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1914 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
1933 io_thread_application_locale_ = locale; | 1915 io_thread_application_locale_ = locale; |
1934 } | 1916 } |
1935 | 1917 |
1936 } // namespace chrome | 1918 } // namespace chrome |
OLD | NEW |