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

Side by Side Diff: chrome/browser/installable/installable_manager.cc

Issue 2956643002: Add GURL::HostNoBracketsPiece() (Closed)
Patch Set: Simplify test Created 3 years, 5 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
« no previous file with comments | « no previous file | chrome/test/chromedriver/net/websocket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/installable/installable_manager.h" 5 #include "chrome/browser/installable/installable_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 service_worker_context_->RemoveObserver(this); 136 service_worker_context_->RemoveObserver(this);
137 } 137 }
138 138
139 // static 139 // static
140 bool InstallableManager::IsContentSecure(content::WebContents* web_contents) { 140 bool InstallableManager::IsContentSecure(content::WebContents* web_contents) {
141 if (!web_contents) 141 if (!web_contents)
142 return false; 142 return false;
143 143
144 // Whitelist localhost. Check the VisibleURL to match what the 144 // Whitelist localhost. Check the VisibleURL to match what the
145 // SecurityStateTabHelper looks at. 145 // SecurityStateTabHelper looks at.
146 if (net::IsLocalhost(web_contents->GetVisibleURL().HostNoBrackets())) 146 if (net::IsLocalhost(web_contents->GetVisibleURL().HostNoBracketsPiece()))
147 return true; 147 return true;
148 148
149 security_state::SecurityInfo security_info; 149 security_state::SecurityInfo security_info;
150 SecurityStateTabHelper::FromWebContents(web_contents) 150 SecurityStateTabHelper::FromWebContents(web_contents)
151 ->GetSecurityInfo(&security_info); 151 ->GetSecurityInfo(&security_info);
152 return security_info.security_level == security_state::SECURE || 152 return security_info.security_level == security_state::SECURE ||
153 security_info.security_level == security_state::EV_SECURE; 153 security_info.security_level == security_state::EV_SECURE;
154 } 154 }
155 155
156 // static 156 // static
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 return manifest_->url; 646 return manifest_->url;
647 } 647 }
648 648
649 const content::Manifest& InstallableManager::manifest() const { 649 const content::Manifest& InstallableManager::manifest() const {
650 return manifest_->manifest; 650 return manifest_->manifest;
651 } 651 }
652 652
653 bool InstallableManager::is_installable() const { 653 bool InstallableManager::is_installable() const {
654 return valid_manifest_->is_valid && worker_->has_worker; 654 return valid_manifest_->is_valid && worker_->has_worker;
655 } 655 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/chromedriver/net/websocket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698