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/browser/api/vpn_provider/vpn_provider_api.h" | 5 #include "extensions/browser/api/vpn_provider/vpn_provider_api.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "extensions/browser/api/vpn_provider/vpn_service.h" | 15 #include "extensions/browser/api/vpn_provider/vpn_service.h" |
16 #include "extensions/browser/api/vpn_provider/vpn_service_factory.h" | 16 #include "extensions/browser/api/vpn_provider/vpn_service_factory.h" |
17 #include "extensions/common/api/vpn_provider.h" | 17 #include "extensions/common/api/vpn_provider.h" |
18 #include "third_party/cros_system_api/dbus/service_constants.h" | 18 #include "third_party/cros_system_api/dbus/service_constants.h" |
19 | 19 |
20 namespace extensions { | 20 namespace extensions { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 namespace api_vpn = extensions::core_api::vpn_provider; | 24 namespace api_vpn = extensions::api::vpn_provider; |
25 | 25 |
26 const char kCIDRSeperator[] = "/"; | 26 const char kCIDRSeperator[] = "/"; |
27 | 27 |
28 bool CheckIPCIDRSanity(const std::string& value, bool cidr, bool ipv6) { | 28 bool CheckIPCIDRSanity(const std::string& value, bool cidr, bool ipv6) { |
29 int dots = ipv6 ? 0 : 3; | 29 int dots = ipv6 ? 0 : 3; |
30 int sep = cidr ? 1 : 0; | 30 int sep = cidr ? 1 : 0; |
31 int colon = ipv6 ? 7 : 0; | 31 int colon = ipv6 ? 7 : 0; |
32 bool hex_allowed = ipv6; | 32 bool hex_allowed = ipv6; |
33 int counter = 0; | 33 int counter = 0; |
34 | 34 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 SignalCallCompletionSuccess, | 323 SignalCallCompletionSuccess, |
324 this), | 324 this), |
325 base::Bind(&VpnProviderNotifyConnectionStateChangedFunction:: | 325 base::Bind(&VpnProviderNotifyConnectionStateChangedFunction:: |
326 SignalCallCompletionFailure, | 326 SignalCallCompletionFailure, |
327 this)); | 327 this)); |
328 | 328 |
329 return RespondLater(); | 329 return RespondLater(); |
330 } | 330 } |
331 | 331 |
332 } // namespace extensions | 332 } // namespace extensions |
OLD | NEW |