| Index: chrome/common/extensions/permissions/chrome_permission_message_provider.cc
|
| diff --git a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
|
| index 26a5ae4693564a2b7aa4e46377cd583a2b66e826..8a1abb40f0f1a9b47dc80b17c67427bee20bf5e7 100644
|
| --- a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
|
| +++ b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
|
| @@ -13,7 +13,6 @@
|
| #include "extensions/common/url_pattern.h"
|
| #include "extensions/common/url_pattern_set.h"
|
| #include "grit/generated_resources.h"
|
| -#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "url/gurl.h"
|
|
|
| @@ -24,44 +23,7 @@ namespace {
|
| typedef std::set<PermissionMessage> PermissionMsgSet;
|
|
|
| bool ShouldWarnAllHosts(const PermissionSet* permissions) {
|
| - if (permissions->HasEffectiveAccessToAllHosts())
|
| - return true;
|
| -
|
| - const URLPatternSet& effective_hosts = permissions->effective_hosts();
|
| - for (URLPatternSet::const_iterator iter = effective_hosts.begin();
|
| - iter != effective_hosts.end();
|
| - ++iter) {
|
| - // If this doesn't even match subdomains, it can't possibly imply all hosts.
|
| - if (!iter->match_subdomains())
|
| - continue;
|
| -
|
| - // If iter->host() is a recognized TLD, this will be 0. We don't include
|
| - // private TLDs, so that, e.g., *.appspot.com does not imply all hosts.
|
| - size_t registry_length =
|
| - net::registry_controlled_domains::GetRegistryLength(
|
| - iter->host(),
|
| - net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
| - net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
| - // If there was more than just a TLD in the host (e.g., *.foobar.com), it
|
| - // doesn't imply all hosts.
|
| - if (registry_length > 0)
|
| - continue;
|
| -
|
| - // At this point the host could either be just a TLD ("com") or some unknown
|
| - // TLD-like string ("notatld"). To disambiguate between them construct a
|
| - // fake URL, and check the registry. This returns 0 if the TLD is
|
| - // unrecognized, or the length of the recognized TLD.
|
| - registry_length = net::registry_controlled_domains::GetRegistryLength(
|
| - base::StringPrintf("foo.%s", iter->host().c_str()),
|
| - net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
| - net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
| - // If we recognized this TLD, then this is a pattern like *.com, and it
|
| - // should imply all hosts.
|
| - if (registry_length > 0)
|
| - return true;
|
| - }
|
| -
|
| - return false;
|
| + return permissions->HasAccessToMostHosts();
|
| }
|
|
|
| template<typename T>
|
|
|