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

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,
113 }; 114 CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER};
msw 2017/03/23 18:18:08 nit: formatting (trailing comma, closing brace on
melandory 2017/03/23 20:05:40 Done.
114 115
115 // Determines whether to show permission |type| in the Website Settings UI. Only 116 // Determines whether to show permission |type| in the Website Settings UI. Only
116 // applies to permissions listed in |kPermissionType|. 117 // applies to permissions listed in |kPermissionType|.
117 bool ShouldShowPermission(ContentSettingsType type) { 118 bool ShouldShowPermission(ContentSettingsType type) {
118 #if !defined(OS_ANDROID) 119 #if !defined(OS_ANDROID)
119 // Autoplay is Android-only at the moment. 120 // Autoplay is Android-only at the moment.
120 if (type == CONTENT_SETTINGS_TYPE_AUTOPLAY) 121 if (type == CONTENT_SETTINGS_TYPE_AUTOPLAY)
121 return false; 122 return false;
122 #endif 123 #endif
123 124
125 if (type == CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER) {
126 return base::FeatureList::IsEnabled(
127 subresource_filter::kSafeBrowsingSubresourceFilterContentSetting);
128 }
129
124 return true; 130 return true;
125 } 131 }
126 132
127 void CheckContentStatus(security_state::ContentStatus content_status, 133 void CheckContentStatus(security_state::ContentStatus content_status,
128 bool* displayed, 134 bool* displayed,
129 bool* ran) { 135 bool* ran) {
130 switch (content_status) { 136 switch (content_status) {
131 case security_state::CONTENT_STATUS_DISPLAYED: 137 case security_state::CONTENT_STATUS_DISPLAYED:
132 *displayed = true; 138 *displayed = true;
133 break; 139 break;
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); 751 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_));
746 752
747 info.connection_status = site_connection_status_; 753 info.connection_status = site_connection_status_;
748 info.connection_status_description = UTF16ToUTF8(site_connection_details_); 754 info.connection_status_description = UTF16ToUTF8(site_connection_details_);
749 info.identity_status = site_identity_status_; 755 info.identity_status = site_identity_status_;
750 info.identity_status_description = UTF16ToUTF8(site_identity_details_); 756 info.identity_status_description = UTF16ToUTF8(site_identity_details_);
751 info.certificate = certificate_; 757 info.certificate = certificate_;
752 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; 758 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_;
753 ui_->SetIdentityInfo(info); 759 ui_->SetIdentityInfo(info);
754 } 760 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698