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

Unified Diff: chrome/browser/ui/browser.cc

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Minor changes from nasko@'s comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/content_settings/content_setting_bubble_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 873a47e4b7821e7a50f9a19abc0675a7194e70c9..5080d69c60d83dec48606e61fca8441857d9119a 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -38,6 +38,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/content_settings/mixed_content_settings_tab_helper.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
@@ -149,6 +150,7 @@
#include "chrome/common/custom_handlers/protocol_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/profiling.h"
+#include "chrome/common/ssl_insecure_content.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
@@ -1347,6 +1349,42 @@ void Browser::RequestAppBannerFromDevTools(content::WebContents* web_contents) {
manager->RequestAppBanner(web_contents->GetLastCommittedURL(), true);
}
+void Browser::PassiveInsecureContentFound(const GURL& resource_url) {
+ // Note: this implementation is a mirror of
+ // ContentSettingsObserver::passiveInsecureContentFound
+ ReportInsecureContent(SslInsecureContentType::DISPLAY);
+ FilteredReportInsecureContentDisplayed(resource_url);
+}
+
+bool Browser::ShouldAllowRunningInsecureContent(
+ content::WebContents* web_contents,
+ bool allowed_per_prefs,
+ const url::Origin& origin,
+ const GURL& resource_url) {
+ // Note: this implementation is a mirror of
+ // ContentSettingsObserver::allowRunningInsecureContent.
+ FilteredReportInsecureContentRan(resource_url);
+
+ MixedContentSettingsTabHelper* mixed_content_settings =
+ MixedContentSettingsTabHelper::FromWebContents(web_contents);
+ DCHECK(mixed_content_settings);
+ if (allowed_per_prefs ||
+ mixed_content_settings->is_running_insecure_content_allowed()) {
+ return true;
+ }
+
+ // Note: this is a browser-side-translation of the call to DidBlockContentType
+ // from inside ContentSettingsObserver::allowRunningInsecureContent.
+ if (!origin.host().empty()) {
+ TabSpecificContentSettings* tab_settings =
+ TabSpecificContentSettings::FromWebContents(web_contents);
+ DCHECK(tab_settings);
+ tab_settings->OnContentBlockedWithDetail(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT,
+ base::UTF8ToUTF16(origin.host()));
+ }
+ return false;
+}
+
bool Browser::IsMouseLocked() const {
return exclusive_access_manager_->mouse_lock_controller()->IsMouseLocked();
}
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/content_settings/content_setting_bubble_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698