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

Side by Side Diff: chrome/browser/infobars/insecure_content_infobar_delegate.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: Overall code cleanup to request reviewers to PTAL. Created 4 years, 5 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/infobars/insecure_content_infobar_delegate.h" 5 #include "chrome/browser/infobars/insecure_content_infobar_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "chrome/browser/content_settings/mixed_content_settings.h"
11 #include "chrome/browser/infobars/infobar_service.h" 12 #include "chrome/browser/infobars/infobar_service.h"
12 #include "chrome/common/render_messages.h" 13 #include "chrome/common/render_messages.h"
13 #include "chrome/grit/generated_resources.h" 14 #include "chrome/grit/generated_resources.h"
14 #include "components/content_settings/content/common/content_settings_messages.h " 15 #include "components/content_settings/content/common/content_settings_messages.h "
15 #include "components/google/core/browser/google_util.h" 16 #include "components/google/core/browser/google_util.h"
16 #include "components/infobars/core/infobar.h" 17 #include "components/infobars/core/infobar.h"
17 #include "content/public/browser/render_frame_host.h" 18 #include "content/public/browser/render_frame_host.h"
18 #include "content/public/browser/render_view_host.h" 19 #include "content/public/browser/render_view_host.h"
19 #include "content/public/browser/web_contents.h" 20 #include "content/public/browser/web_contents.h"
20 #include "grit/components_strings.h" 21 #include "grit/components_strings.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 88 }
88 89
89 // Cancel button is labelled "load anyways". It triggers Cancel(), but really 90 // Cancel button is labelled "load anyways". It triggers Cancel(), but really
90 // means become insecure, so do the work of reloading the page. 91 // means become insecure, so do the work of reloading the page.
91 bool InsecureContentInfoBarDelegate::Cancel() { 92 bool InsecureContentInfoBarDelegate::Cancel() {
92 UMA_HISTOGRAM_ENUMERATION("InsecureContentInfoBarDelegateV2", 93 UMA_HISTOGRAM_ENUMERATION("InsecureContentInfoBarDelegateV2",
93 DISPLAY_USER_OVERRIDE, NUM_EVENTS); 94 DISPLAY_USER_OVERRIDE, NUM_EVENTS);
94 95
95 content::WebContents* web_contents = 96 content::WebContents* web_contents =
96 InfoBarService::WebContentsFromInfoBar(infobar()); 97 InfoBarService::WebContentsFromInfoBar(infobar());
98 MixedContentSettings* mixed_content_settings =
99 MixedContentSettings::FromWebContents(web_contents);
100 mixed_content_settings->AllowDisplayingOfInsecureContent();
carlosk 2016/07/18 14:37:13 Does it makes more sense to move this code below t
97 web_contents->SendToAllFrames( 101 web_contents->SendToAllFrames(
98 new ChromeViewMsg_SetAllowDisplayingInsecureContent( 102 new ChromeViewMsg_SetAllowDisplayingInsecureContent(
99 MSG_ROUTING_NONE, true)); 103 MSG_ROUTING_NONE, true));
100 web_contents->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( 104 web_contents->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame(
101 web_contents->GetMainFrame()->GetRoutingID())); 105 web_contents->GetMainFrame()->GetRoutingID()));
102 return true; 106 return true;
103 } 107 }
104 108
105 base::string16 InsecureContentInfoBarDelegate::GetLinkText() const { 109 base::string16 InsecureContentInfoBarDelegate::GetLinkText() const {
106 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); 110 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
107 } 111 }
108 112
109 GURL InsecureContentInfoBarDelegate::GetLinkURL() const { 113 GURL InsecureContentInfoBarDelegate::GetLinkURL() const {
110 return GURL("https://support.google.com/chrome/answer/1342714"); 114 return GURL("https://support.google.com/chrome/answer/1342714");
111 } 115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698