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

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

Issue 1314843007: Refactor connection_security into SecurityStateModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: palmer comments #2 Created 5 years, 3 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/extensions/hosted_app_browser_controller.cc
diff --git a/chrome/browser/ui/extensions/hosted_app_browser_controller.cc b/chrome/browser/ui/extensions/hosted_app_browser_controller.cc
index 220f990d43e352e93995f7624e4e9d393a1823f3..5834206a1226b2a55a9d588fafe1a67526beef18 100644
--- a/chrome/browser/ui/extensions/hosted_app_browser_controller.cc
+++ b/chrome/browser/ui/extensions/hosted_app_browser_controller.cc
@@ -6,7 +6,7 @@
#include "base/command_line.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ssl/connection_security.h"
+#include "chrome/browser/ssl/security_state_model.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/host_desktop.h"
@@ -77,7 +77,7 @@ bool HostedAppBrowserController::ShouldShowLocationBar() const {
ExtensionRegistry::Get(browser_->profile())->GetExtensionById(
extension_id_, ExtensionRegistry::EVERYTHING);
- const content::WebContents* web_contents =
+ content::WebContents* web_contents =
browser_->tab_strip_model()->GetActiveWebContents();
// Default to not showing the location bar if either |extension| or
@@ -92,10 +92,13 @@ bool HostedAppBrowserController::ShouldShowLocationBar() const {
if (web_contents->GetLastCommittedURL().is_empty())
return false;
- connection_security::SecurityLevel security_level =
- connection_security::GetSecurityLevelForWebContents(web_contents);
- if (security_level == connection_security::SECURITY_ERROR)
- return true;
+ SecurityStateModel* model = SecurityStateModel::FromWebContents(web_contents);
+ if (model) {
Peter Kasting 2015/09/03 18:25:53 Nit: Combine these two conditionals
estark 2015/09/03 22:11:57 Done.
+ if (model->security_info().security_level ==
+ SecurityStateModel::SECURITY_ERROR) {
Peter Kasting 2015/09/03 18:25:53 Nit: No {} necessary
estark 2015/09/03 22:11:57 Done.
+ return true;
+ }
+ }
GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension);
return !(IsSameOriginOrMoreSecure(launch_url,

Powered by Google App Engine
This is Rietveld 408576698