Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2938163002: Store base::Value in ContentSettingPatternSource instead of an enum (Closed)
Patch Set: ps Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 return ratio * (kMaxFSM - kMinFSM) + kMinFSM; 790 return ratio * (kMaxFSM - kMinFSM) + kMinFSM;
790 } 791 }
791 792
792 #endif // defined(OS_ANDROID) 793 #endif // defined(OS_ANDROID)
793 794
794 #if BUILDFLAG(ENABLE_EXTENSIONS) 795 #if BUILDFLAG(ENABLE_EXTENSIONS)
795 // By default, JavaScript, images and autoplay are enabled in guest content. 796 // By default, JavaScript, images and autoplay are enabled in guest content.
796 void GetGuestViewDefaultContentSettingRules( 797 void GetGuestViewDefaultContentSettingRules(
797 bool incognito, 798 bool incognito,
798 RendererContentSettingRules* rules) { 799 RendererContentSettingRules* rules) {
799 rules->image_rules.push_back( 800 rules->image_rules.push_back(ContentSettingPatternSource(
800 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), 801 ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(),
801 ContentSettingsPattern::Wildcard(), 802 base::Value(CONTENT_SETTING_ALLOW), std::string(), incognito));
802 CONTENT_SETTING_ALLOW,
803 std::string(),
804 incognito));
805 803
806 rules->script_rules.push_back( 804 rules->script_rules.push_back(ContentSettingPatternSource(
807 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), 805 ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(),
808 ContentSettingsPattern::Wildcard(), 806 base::Value(CONTENT_SETTING_ALLOW), std::string(), incognito));
809 CONTENT_SETTING_ALLOW, 807 rules->autoplay_rules.push_back(ContentSettingPatternSource(
810 std::string(), 808 ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(),
811 incognito)); 809 base::Value(CONTENT_SETTING_ALLOW), std::string(), incognito));
812 rules->autoplay_rules.push_back(
813 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
814 ContentSettingsPattern::Wildcard(),
815 CONTENT_SETTING_ALLOW,
816 std::string(),
817 incognito));
818 } 810 }
819 811
820 AppLoadedInTabSource ClassifyAppLoadedInTabSource( 812 AppLoadedInTabSource ClassifyAppLoadedInTabSource(
821 const GURL& opener_url, 813 const GURL& opener_url,
822 const extensions::Extension* target_platform_app) { 814 const extensions::Extension* target_platform_app) {
823 if (opener_url.SchemeIs(extensions::kExtensionScheme)) { 815 if (opener_url.SchemeIs(extensions::kExtensionScheme)) {
824 if (opener_url.host_piece() == target_platform_app->id()) { 816 if (opener_url.host_piece() == target_platform_app->id()) {
825 // This platform app was trying to window.open() one of its own URLs. 817 // This platform app was trying to window.open() one of its own URLs.
826 if (opener_url == 818 if (opener_url ==
827 extensions::BackgroundInfo::GetBackgroundURL(target_platform_app)) { 819 extensions::BackgroundInfo::GetBackgroundURL(target_platform_app)) {
(...skipping 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after
3457 safe_browsing_service_->database_manager(), 3449 safe_browsing_service_->database_manager(),
3458 safe_browsing_service_->ui_manager(), wc_getter)); 3450 safe_browsing_service_->ui_manager(), wc_getter));
3459 return result; 3451 return result;
3460 } 3452 }
3461 3453
3462 // static 3454 // static
3463 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( 3455 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(
3464 const storage::QuotaSettings* settings) { 3456 const storage::QuotaSettings* settings) {
3465 g_default_quota_settings = settings; 3457 g_default_quota_settings = settings;
3466 } 3458 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698