Chromium Code Reviews| 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) |
|
Mathieu
2017/01/25 17:03:41
I think it's good to carry over the comment about
estark
2017/01/25 17:23:15
As elawrence mentioned, I don't think we should tr
|
| + 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) { |