| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/common/api/sockets/sockets_manifest_permission.h" | 5 #include "extensions/common/api/sockets/sockets_manifest_permission.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "extensions/common/api/extensions_manifest_types.h" | 12 #include "extensions/common/api/extensions_manifest_types.h" |
| 13 #include "extensions/common/api/sockets/sockets_manifest_data.h" | 13 #include "extensions/common/api/sockets/sockets_manifest_data.h" |
| 14 #include "extensions/common/error_utils.h" | 14 #include "extensions/common/error_utils.h" |
| 15 #include "extensions/common/manifest_constants.h" | 15 #include "extensions/common/manifest_constants.h" |
| 16 #include "grit/extensions_strings.h" | 16 #include "grit/extensions_strings.h" |
| 17 #include "ipc/ipc_message.h" | 17 #include "ipc/ipc_message.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 19 | 19 |
| 20 namespace extensions { | 20 namespace extensions { |
| 21 | 21 |
| 22 namespace sockets_errors { | 22 namespace sockets_errors { |
| 23 const char kErrorInvalidHostPattern[] = "Invalid host:port pattern '*'"; | 23 const char kErrorInvalidHostPattern[] = "Invalid host:port pattern '*'"; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace errors = sockets_errors; | 26 namespace errors = sockets_errors; |
| 27 using core_api::extensions_manifest_types::Sockets; | 27 using api::extensions_manifest_types::Sockets; |
| 28 using core_api::extensions_manifest_types::SocketHostPatterns; | 28 using api::extensions_manifest_types::SocketHostPatterns; |
| 29 using content::SocketPermissionRequest; | 29 using content::SocketPermissionRequest; |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 static bool ParseHostPattern( | 33 static bool ParseHostPattern( |
| 34 SocketsManifestPermission* permission, | 34 SocketsManifestPermission* permission, |
| 35 content::SocketPermissionRequest::OperationType operation_type, | 35 content::SocketPermissionRequest::OperationType operation_type, |
| 36 const std::string& host_pattern, | 36 const std::string& host_pattern, |
| 37 base::string16* error) { | 37 base::string16* error) { |
| 38 SocketPermissionEntry entry; | 38 SocketPermissionEntry entry; |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 PermissionIDSet* ids, | 374 PermissionIDSet* ids, |
| 375 PermissionMessages* messages) { | 375 PermissionMessages* messages) { |
| 376 if (!AddAnyHostMessage(sockets, ids, messages)) { | 376 if (!AddAnyHostMessage(sockets, ids, messages)) { |
| 377 AddSpecificHostMessage(sockets, ids, messages); | 377 AddSpecificHostMessage(sockets, ids, messages); |
| 378 AddSubdomainHostMessage(sockets, ids, messages); | 378 AddSubdomainHostMessage(sockets, ids, messages); |
| 379 } | 379 } |
| 380 AddNetworkListMessage(sockets, ids, messages); | 380 AddNetworkListMessage(sockets, ids, messages); |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace extensions | 383 } // namespace extensions |
| OLD | NEW |