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