| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/extensions/manifest_handlers/externally_connectable.h" | 5 #include "chrome/common/extensions/manifest_handlers/externally_connectable.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/common/extensions/api/manifest_types.h" | 11 #include "chrome/common/extensions/api/manifest_types.h" |
| 12 #include "chrome/common/extensions/permissions/permissions_data.h" | |
| 13 #include "extensions/common/error_utils.h" | 12 #include "extensions/common/error_utils.h" |
| 14 #include "extensions/common/manifest_constants.h" | 13 #include "extensions/common/manifest_constants.h" |
| 15 #include "extensions/common/permissions/api_permission_set.h" | 14 #include "extensions/common/permissions/api_permission_set.h" |
| 15 #include "extensions/common/permissions/permissions_data.h" |
| 16 #include "extensions/common/url_pattern.h" | 16 #include "extensions/common/url_pattern.h" |
| 17 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 17 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 namespace rcd = net::registry_controlled_domains; | 20 namespace rcd = net::registry_controlled_domains; |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 | 23 |
| 24 namespace externally_connectable_errors { | 24 namespace externally_connectable_errors { |
| 25 const char kErrorInvalidMatchPattern[] = "Invalid match pattern '*'"; | 25 const char kErrorInvalidMatchPattern[] = "Invalid match pattern '*'"; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 accepts_tls_channel_id(accepts_tls_channel_id) {} | 204 accepts_tls_channel_id(accepts_tls_channel_id) {} |
| 205 | 205 |
| 206 bool ExternallyConnectableInfo::IdCanConnect(const std::string& id) { | 206 bool ExternallyConnectableInfo::IdCanConnect(const std::string& id) { |
| 207 if (all_ids) | 207 if (all_ids) |
| 208 return true; | 208 return true; |
| 209 DCHECK(base::STLIsSorted(ids)); | 209 DCHECK(base::STLIsSorted(ids)); |
| 210 return std::binary_search(ids.begin(), ids.end(), id); | 210 return std::binary_search(ids.begin(), ids.end(), id); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace extensions | 213 } // namespace extensions |
| OLD | NEW |