OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 // or when hitting an unknown test cert and that commonly happens in | 334 // or when hitting an unknown test cert and that commonly happens in |
335 // testing environments. Given this, we allow an empty referrer when | 335 // testing environments. Given this, we allow an empty referrer when |
336 // the command-line flag is set. | 336 // the command-line flag is set. |
337 // Otherwise, the TLD must match the TLD of the command-line url. | 337 // Otherwise, the TLD must match the TLD of the command-line url. |
338 referrer_valid = referrer_url.is_empty() || (referrer_tld == store_tld); | 338 referrer_valid = referrer_url.is_empty() || (referrer_tld == store_tld); |
339 } | 339 } |
340 | 340 |
341 if (!download_valid) { | 341 if (!download_valid) { |
342 std::string download_tld = | 342 std::string download_tld = |
343 net::RegistryControlledDomainService::GetDomainAndRegistry( | 343 net::RegistryControlledDomainService::GetDomainAndRegistry( |
344 GURL(download_url)); | 344 download_url); |
345 | 345 |
346 // Otherwise, the TLD must match the TLD of the command-line url. | 346 // Otherwise, the TLD must match the TLD of the command-line url. |
347 download_valid = (download_tld == store_tld); | 347 download_valid = (download_tld == store_tld); |
348 } | 348 } |
349 } | 349 } |
350 | 350 |
351 return (referrer_valid && download_valid); | 351 return (referrer_valid && download_valid); |
352 } | 352 } |
353 | 353 |
354 bool ExtensionService::IsDownloadFromMiniGallery(const GURL& download_url) { | 354 bool ExtensionService::IsDownloadFromMiniGallery(const GURL& download_url) { |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2135 | 2135 |
2136 ExtensionService::NaClModuleInfoList::iterator | 2136 ExtensionService::NaClModuleInfoList::iterator |
2137 ExtensionService::FindNaClModule(const GURL& url) { | 2137 ExtensionService::FindNaClModule(const GURL& url) { |
2138 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2138 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2139 iter != nacl_module_list_.end(); ++iter) { | 2139 iter != nacl_module_list_.end(); ++iter) { |
2140 if (iter->url == url) | 2140 if (iter->url == url) |
2141 return iter; | 2141 return iter; |
2142 } | 2142 } |
2143 return nacl_module_list_.end(); | 2143 return nacl_module_list_.end(); |
2144 } | 2144 } |
OLD | NEW |