Commit 4d146d0b authored by benwells's avatar benwells Committed by Commit bot

Show the location bar in bookmark apps with security errors.

For example, if the certificate is expired.

BUG=442930

Review URL: https://codereview.chromium.org/1148743002

Cr-Commit-Position: refs/heads/master@{#330833}
parent f8e12998
...@@ -57,7 +57,7 @@ GetSecurityLevelForNonSecureFieldTrial() { ...@@ -57,7 +57,7 @@ GetSecurityLevelForNonSecureFieldTrial() {
ConnectionSecurityHelper::SecurityLevel ConnectionSecurityHelper::SecurityLevel
ConnectionSecurityHelper::GetSecurityLevelForWebContents( ConnectionSecurityHelper::GetSecurityLevelForWebContents(
content::WebContents* web_contents) { const content::WebContents* web_contents) {
if (!web_contents) if (!web_contents)
return NONE; return NONE;
......
...@@ -50,7 +50,7 @@ class ConnectionSecurityHelper { ...@@ -50,7 +50,7 @@ class ConnectionSecurityHelper {
// Returns a security level describing the overall security state of // Returns a security level describing the overall security state of
// the given |WebContents|. // the given |WebContents|.
static SecurityLevel GetSecurityLevelForWebContents( static SecurityLevel GetSecurityLevelForWebContents(
content::WebContents* web_contents); const content::WebContents* web_contents);
private: private:
DISALLOW_IMPLICIT_CONSTRUCTORS(ConnectionSecurityHelper); DISALLOW_IMPLICIT_CONSTRUCTORS(ConnectionSecurityHelper);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/connection_security_helper.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/host_desktop.h"
...@@ -83,6 +84,11 @@ bool BookmarkAppBrowserController::ShouldShowLocationBar() { ...@@ -83,6 +84,11 @@ bool BookmarkAppBrowserController::ShouldShowLocationBar() {
if (web_contents->GetLastCommittedURL().is_empty()) if (web_contents->GetLastCommittedURL().is_empty())
return false; return false;
ConnectionSecurityHelper::SecurityLevel security_level =
ConnectionSecurityHelper::GetSecurityLevelForWebContents(web_contents);
if (security_level == ConnectionSecurityHelper::SECURITY_ERROR)
return true;
GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension); GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension);
return !(IsSameOriginOrMoreSecure(launch_url, return !(IsSameOriginOrMoreSecure(launch_url,
web_contents->GetVisibleURL()) && web_contents->GetVisibleURL()) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment