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

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

Issue 2660293002: Show Page Info from Form-Not-Secure 'Learn more' link (Closed)
Patch Set: Created 3 years, 11 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
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 49c5ad4ae3e8bdfa290552ad415ad50505e79f48..7dc18933553425ab72e281ba280e9af5177f5b26 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/search/search.h"
#include "chrome/browser/sessions/session_service_factory.h"
#include "chrome/browser/sessions/tab_restore_service_factory.h"
+#include "chrome/browser/ssl/security_state_tab_helper.h"
#include "chrome/browser/translate/chrome_translate_client.h"
#include "chrome/browser/ui/accelerator_utils.h"
#include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h"
@@ -62,6 +63,7 @@
#include "components/favicon/content/content_favicon_driver.h"
#include "components/google/core/browser/google_util.h"
#include "components/prefs/pref_service.h"
+#include "components/security_state/core/security_state.h"
#include "components/sessions/core/live_tab_context.h"
#include "components/sessions/core/tab_restore_service.h"
#include "components/signin/core/browser/signin_header_helper.h"
@@ -896,13 +898,21 @@ void ShowFindBar(Browser* browser) {
browser->GetFindBarController()->Show();
}
-void ShowWebsiteSettings(Browser* browser,
- content::WebContents* web_contents,
- const GURL& url,
- const security_state::SecurityInfo& security_info) {
+bool ShowWebsiteSettings(Browser* browser, content::WebContents* web_contents) {
+ content::NavigationEntry* entry =
+ web_contents->GetController().GetVisibleEntry();
+ if (!entry)
+ return false;
+
+ SecurityStateTabHelper* helper =
+ SecurityStateTabHelper::FromWebContents(web_contents);
+ security_state::SecurityInfo security_info;
+ helper->GetSecurityInfo(&security_info);
+
browser->window()->ShowWebsiteSettings(
Profile::FromBrowserContext(web_contents->GetBrowserContext()),
- web_contents, url, security_info);
+ web_contents, entry->GetVirtualURL(), security_info);
+ return true;
}
void Print(Browser* browser) {
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/cocoa/location_bar/location_icon_decoration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698