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

Side by Side Diff: chrome/browser/ui/extensions/hosted_app_browser_controller.cc

Issue 1539043002: Pull SecurityStateModel out into a component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ui/extensions/hosted_app_browser_controller.h" 5 #include "chrome/browser/ui/extensions/hosted_app_browser_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ssl/chrome_security_state_model_client.h" 9 #include "chrome/browser/ssl/chrome_security_state_model_client.h"
10 #include "chrome/browser/ssl/security_state_model.h"
11 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/browser_window.h" 11 #include "chrome/browser/ui/browser_window.h"
13 #include "chrome/browser/ui/host_desktop.h" 12 #include "chrome/browser/ui/host_desktop.h"
14 #include "chrome/browser/ui/location_bar/location_bar.h" 13 #include "chrome/browser/ui/location_bar/location_bar.h"
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" 14 #include "chrome/browser/ui/tabs/tab_strip_model.h"
16 #include "chrome/browser/web_applications/web_app.h" 15 #include "chrome/browser/web_applications/web_app.h"
17 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
18 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" 17 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
18 #include "components/security_state/security_state_model.h"
19 #include "content/public/browser/web_contents.h" 19 #include "content/public/browser/web_contents.h"
20 #include "extensions/browser/extension_registry.h" 20 #include "extensions/browser/extension_registry.h"
21 #include "extensions/common/extension.h" 21 #include "extensions/common/extension.h"
22 #include "net/base/net_util.h" 22 #include "net/base/net_util.h"
23 #include "url/gurl.h" 23 #include "url/gurl.h"
24 24
25 namespace extensions { 25 namespace extensions {
26 26
27 namespace { 27 namespace {
28 28
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return false; 90 return false;
91 91
92 // Don't show a location bar until a navigation has occurred. 92 // Don't show a location bar until a navigation has occurred.
93 if (web_contents->GetLastCommittedURL().is_empty()) 93 if (web_contents->GetLastCommittedURL().is_empty())
94 return false; 94 return false;
95 95
96 const ChromeSecurityStateModelClient* model_client = 96 const ChromeSecurityStateModelClient* model_client =
97 ChromeSecurityStateModelClient::FromWebContents(web_contents); 97 ChromeSecurityStateModelClient::FromWebContents(web_contents);
98 if (model_client && 98 if (model_client &&
99 model_client->GetSecurityInfo().security_level == 99 model_client->GetSecurityInfo().security_level ==
100 SecurityStateModel::SECURITY_ERROR) 100 security_state::SecurityStateModel::SECURITY_ERROR)
101 return true; 101 return true;
102 102
103 GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension); 103 GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension);
104 return !(IsSameOriginOrMoreSecure(launch_url, 104 return !(IsSameOriginOrMoreSecure(launch_url,
105 web_contents->GetVisibleURL()) && 105 web_contents->GetVisibleURL()) &&
106 IsSameOriginOrMoreSecure(launch_url, 106 IsSameOriginOrMoreSecure(launch_url,
107 web_contents->GetLastCommittedURL())); 107 web_contents->GetLastCommittedURL()));
108 } 108 }
109 109
110 void HostedAppBrowserController::UpdateLocationBarVisibility( 110 void HostedAppBrowserController::UpdateLocationBarVisibility(
111 bool animate) const { 111 bool animate) const {
112 if (!SupportsLocationBar()) 112 if (!SupportsLocationBar())
113 return; 113 return;
114 114
115 browser_->window()->GetLocationBar()->UpdateLocationBarVisibility( 115 browser_->window()->GetLocationBar()->UpdateLocationBarVisibility(
116 ShouldShowLocationBar(), animate); 116 ShouldShowLocationBar(), animate);
117 } 117 }
118 118
119 } // namespace extensions 119 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698