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

Side by Side Diff: chrome/browser/ui/page_info/website_settings.cc

Issue 2682293002: Add desktop UI for the subresource filter content setting. (Closed)
Patch Set: comments Created 3 years, 9 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/ui/page_info/website_settings.h" 5 #include "chrome/browser/ui/page_info/website_settings.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "chrome/grit/theme_resources.h" 49 #include "chrome/grit/theme_resources.h"
50 #include "components/content_settings/core/browser/content_settings_utils.h" 50 #include "components/content_settings/core/browser/content_settings_utils.h"
51 #include "components/content_settings/core/browser/host_content_settings_map.h" 51 #include "components/content_settings/core/browser/host_content_settings_map.h"
52 #include "components/content_settings/core/common/content_settings.h" 52 #include "components/content_settings/core/common/content_settings.h"
53 #include "components/content_settings/core/common/content_settings_pattern.h" 53 #include "components/content_settings/core/common/content_settings_pattern.h"
54 #include "components/rappor/public/rappor_utils.h" 54 #include "components/rappor/public/rappor_utils.h"
55 #include "components/rappor/rappor_service_impl.h" 55 #include "components/rappor/rappor_service_impl.h"
56 #include "components/ssl_errors/error_info.h" 56 #include "components/ssl_errors/error_info.h"
57 #include "components/strings/grit/components_chromium_strings.h" 57 #include "components/strings/grit/components_chromium_strings.h"
58 #include "components/strings/grit/components_strings.h" 58 #include "components/strings/grit/components_strings.h"
59 #include "components/subresource_filter/core/browser/subresource_filter_features .h"
59 #include "components/url_formatter/elide_url.h" 60 #include "components/url_formatter/elide_url.h"
60 #include "content/public/browser/browser_thread.h" 61 #include "content/public/browser/browser_thread.h"
61 #include "content/public/browser/user_metrics.h" 62 #include "content/public/browser/user_metrics.h"
62 #include "content/public/common/content_switches.h" 63 #include "content/public/common/content_switches.h"
63 #include "content/public/common/url_constants.h" 64 #include "content/public/common/url_constants.h"
64 #include "net/cert/cert_status_flags.h" 65 #include "net/cert/cert_status_flags.h"
65 #include "net/cert/x509_certificate.h" 66 #include "net/cert/x509_certificate.h"
66 #include "net/ssl/ssl_cipher_suite_names.h" 67 #include "net/ssl/ssl_cipher_suite_names.h"
67 #include "net/ssl/ssl_connection_status_flags.h" 68 #include "net/ssl/ssl_connection_status_flags.h"
68 #include "third_party/boringssl/src/include/openssl/ssl.h" 69 #include "third_party/boringssl/src/include/openssl/ssl.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 CONTENT_SETTINGS_TYPE_JAVASCRIPT, 104 CONTENT_SETTINGS_TYPE_JAVASCRIPT,
104 #if !defined(OS_ANDROID) 105 #if !defined(OS_ANDROID)
105 CONTENT_SETTINGS_TYPE_PLUGINS, 106 CONTENT_SETTINGS_TYPE_PLUGINS,
106 CONTENT_SETTINGS_TYPE_IMAGES, 107 CONTENT_SETTINGS_TYPE_IMAGES,
107 #endif 108 #endif
108 CONTENT_SETTINGS_TYPE_POPUPS, 109 CONTENT_SETTINGS_TYPE_POPUPS,
109 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, 110 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC,
110 CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, 111 CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS,
111 CONTENT_SETTINGS_TYPE_AUTOPLAY, 112 CONTENT_SETTINGS_TYPE_AUTOPLAY,
112 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, 113 CONTENT_SETTINGS_TYPE_MIDI_SYSEX,
114 CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER,
113 }; 115 };
114 116
115 // Determines whether to show permission |type| in the Website Settings UI. Only 117 // Determines whether to show permission |type| in the Website Settings UI. Only
116 // applies to permissions listed in |kPermissionType|. 118 // applies to permissions listed in |kPermissionType|.
117 bool ShouldShowPermission(ContentSettingsType type) { 119 bool ShouldShowPermission(ContentSettingsType type) {
118 #if !defined(OS_ANDROID) 120 #if !defined(OS_ANDROID)
119 // Autoplay is Android-only at the moment. 121 // Autoplay is Android-only at the moment.
120 if (type == CONTENT_SETTINGS_TYPE_AUTOPLAY) 122 if (type == CONTENT_SETTINGS_TYPE_AUTOPLAY)
121 return false; 123 return false;
122 #endif 124 #endif
123 125
126 if (type == CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER) {
127 return base::FeatureList::IsEnabled(
128 subresource_filter::kSafeBrowsingSubresourceFilterContentSetting);
129 }
130
124 return true; 131 return true;
125 } 132 }
126 133
127 void CheckContentStatus(security_state::ContentStatus content_status, 134 void CheckContentStatus(security_state::ContentStatus content_status,
128 bool* displayed, 135 bool* displayed,
129 bool* ran) { 136 bool* ran) {
130 switch (content_status) { 137 switch (content_status) {
131 case security_state::CONTENT_STATUS_DISPLAYED: 138 case security_state::CONTENT_STATUS_DISPLAYED:
132 *displayed = true; 139 *displayed = true;
133 break; 140 break;
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); 752 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_));
746 753
747 info.connection_status = site_connection_status_; 754 info.connection_status = site_connection_status_;
748 info.connection_status_description = UTF16ToUTF8(site_connection_details_); 755 info.connection_status_description = UTF16ToUTF8(site_connection_details_);
749 info.identity_status = site_identity_status_; 756 info.identity_status = site_identity_status_;
750 info.identity_status_description = UTF16ToUTF8(site_identity_details_); 757 info.identity_status_description = UTF16ToUTF8(site_identity_details_);
751 info.certificate = certificate_; 758 info.certificate = certificate_;
752 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; 759 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_;
753 ui_->SetIdentityInfo(info); 760 ui_->SetIdentityInfo(info);
754 } 761 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698