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 <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 126 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
127 #include "components/autofill/core/common/autofill_switches.h" | 127 #include "components/autofill/core/common/autofill_switches.h" |
128 #include "components/browsing_data/core/browsing_data_utils.h" | 128 #include "components/browsing_data/core/browsing_data_utils.h" |
129 #include "components/cdm/browser/cdm_message_filter_android.h" | 129 #include "components/cdm/browser/cdm_message_filter_android.h" |
130 #include "components/cloud_devices/common/cloud_devices_switches.h" | 130 #include "components/cloud_devices/common/cloud_devices_switches.h" |
131 #include "components/content_settings/core/browser/content_settings_utils.h" | 131 #include "components/content_settings/core/browser/content_settings_utils.h" |
132 #include "components/content_settings/core/browser/cookie_settings.h" | 132 #include "components/content_settings/core/browser/cookie_settings.h" |
133 #include "components/content_settings/core/browser/host_content_settings_map.h" | 133 #include "components/content_settings/core/browser/host_content_settings_map.h" |
134 #include "components/content_settings/core/common/content_settings.h" | 134 #include "components/content_settings/core/common/content_settings.h" |
135 #include "components/content_settings/core/common/content_settings_types.h" | 135 #include "components/content_settings/core/common/content_settings_types.h" |
| 136 #include "components/content_settings/core/common/content_settings_utils.h" |
136 #include "components/dom_distiller/core/dom_distiller_switches.h" | 137 #include "components/dom_distiller/core/dom_distiller_switches.h" |
137 #include "components/dom_distiller/core/url_constants.h" | 138 #include "components/dom_distiller/core/url_constants.h" |
138 #include "components/error_page/common/error_page_switches.h" | 139 #include "components/error_page/common/error_page_switches.h" |
139 #include "components/google/core/browser/google_util.h" | 140 #include "components/google/core/browser/google_util.h" |
140 #include "components/metrics/call_stack_profile_collector.h" | 141 #include "components/metrics/call_stack_profile_collector.h" |
141 #include "components/metrics/client_info.h" | 142 #include "components/metrics/client_info.h" |
142 #include "components/nacl/common/nacl_constants.h" | 143 #include "components/nacl/common/nacl_constants.h" |
143 #include "components/net_log/chrome_net_log.h" | 144 #include "components/net_log/chrome_net_log.h" |
144 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" | 145 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" |
145 #include "components/pref_registry/pref_registry_syncable.h" | 146 #include "components/pref_registry/pref_registry_syncable.h" |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 return ratio * (kMaxFSM - kMinFSM) + kMinFSM; | 749 return ratio * (kMaxFSM - kMinFSM) + kMinFSM; |
749 } | 750 } |
750 | 751 |
751 #endif // defined(OS_ANDROID) | 752 #endif // defined(OS_ANDROID) |
752 | 753 |
753 #if BUILDFLAG(ENABLE_EXTENSIONS) | 754 #if BUILDFLAG(ENABLE_EXTENSIONS) |
754 // By default, JavaScript, images and autoplay are enabled in guest content. | 755 // By default, JavaScript, images and autoplay are enabled in guest content. |
755 void GetGuestViewDefaultContentSettingRules( | 756 void GetGuestViewDefaultContentSettingRules( |
756 bool incognito, | 757 bool incognito, |
757 RendererContentSettingRules* rules) { | 758 RendererContentSettingRules* rules) { |
758 rules->image_rules.push_back( | 759 rules->image_rules.push_back(ContentSettingPatternSource( |
759 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), | 760 ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), |
760 ContentSettingsPattern::Wildcard(), | 761 content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), |
761 CONTENT_SETTING_ALLOW, | 762 std::string(), incognito)); |
762 std::string(), | |
763 incognito)); | |
764 | 763 |
765 rules->script_rules.push_back( | 764 rules->script_rules.push_back(ContentSettingPatternSource( |
766 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), | 765 ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), |
767 ContentSettingsPattern::Wildcard(), | 766 content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), |
768 CONTENT_SETTING_ALLOW, | 767 std::string(), incognito)); |
769 std::string(), | 768 rules->autoplay_rules.push_back(ContentSettingPatternSource( |
770 incognito)); | 769 ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), |
771 rules->autoplay_rules.push_back( | 770 content_settings::ContentSettingToValue(CONTENT_SETTING_ALLOW), |
772 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), | 771 std::string(), incognito)); |
773 ContentSettingsPattern::Wildcard(), | |
774 CONTENT_SETTING_ALLOW, | |
775 std::string(), | |
776 incognito)); | |
777 } | 772 } |
778 | 773 |
779 AppLoadedInTabSource ClassifyAppLoadedInTabSource( | 774 AppLoadedInTabSource ClassifyAppLoadedInTabSource( |
780 const GURL& opener_url, | 775 const GURL& opener_url, |
781 const extensions::Extension* target_platform_app) { | 776 const extensions::Extension* target_platform_app) { |
782 if (opener_url.SchemeIs(extensions::kExtensionScheme)) { | 777 if (opener_url.SchemeIs(extensions::kExtensionScheme)) { |
783 if (opener_url.host_piece() == target_platform_app->id()) { | 778 if (opener_url.host_piece() == target_platform_app->id()) { |
784 // This platform app was trying to window.open() one of its own URLs. | 779 // This platform app was trying to window.open() one of its own URLs. |
785 if (opener_url == | 780 if (opener_url == |
786 extensions::BackgroundInfo::GetBackgroundURL(target_platform_app)) { | 781 extensions::BackgroundInfo::GetBackgroundURL(target_platform_app)) { |
(...skipping 2683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3470 // displayed URL when rewriting chrome://help to chrome://settings/help. | 3465 // displayed URL when rewriting chrome://help to chrome://settings/help. |
3471 return url->SchemeIs(content::kChromeUIScheme) && | 3466 return url->SchemeIs(content::kChromeUIScheme) && |
3472 url->host() == chrome::kChromeUISettingsHost; | 3467 url->host() == chrome::kChromeUISettingsHost; |
3473 } | 3468 } |
3474 | 3469 |
3475 // static | 3470 // static |
3476 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3471 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
3477 const storage::QuotaSettings* settings) { | 3472 const storage::QuotaSettings* settings) { |
3478 g_default_quota_settings = settings; | 3473 g_default_quota_settings = settings; |
3479 } | 3474 } |
OLD | NEW |