OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chromeos/network/network_connection_handler.h" | 5 #include "chromeos/network/network_connection_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 bool NetworkRequiresActivation(const NetworkState* network) { | 59 bool NetworkRequiresActivation(const NetworkState* network) { |
60 return (network->type() == flimflam::kTypeCellular && | 60 return (network->type() == flimflam::kTypeCellular && |
61 (network->activation_state() != flimflam::kActivationStateActivated || | 61 (network->activation_state() != flimflam::kActivationStateActivated || |
62 network->cellular_out_of_credits())); | 62 network->cellular_out_of_credits())); |
63 } | 63 } |
64 | 64 |
65 bool VPNIsConfigured(const std::string& service_path, | 65 bool VPNIsConfigured(const std::string& service_path, |
66 const base::DictionaryValue& service_properties) { | 66 const base::DictionaryValue& service_properties) { |
67 const DictionaryValue* properties; | 67 const base::DictionaryValue* properties; |
68 if (!service_properties.GetDictionary(flimflam::kProviderProperty, | 68 if (!service_properties.GetDictionary(flimflam::kProviderProperty, |
69 &properties)) { | 69 &properties)) { |
70 NET_LOG_ERROR("VPN Provider Dictionary not present", service_path); | 70 NET_LOG_ERROR("VPN Provider Dictionary not present", service_path); |
71 return false; | 71 return false; |
72 } | 72 } |
73 std::string provider_type; | 73 std::string provider_type; |
74 // Note: we use Value path expansion to extract Provider.Type. | 74 // Note: we use Value path expansion to extract Provider.Type. |
75 if (!properties->GetString(flimflam::kTypeProperty, &provider_type)) { | 75 if (!properties->GetString(flimflam::kTypeProperty, &provider_type)) { |
76 NET_LOG_ERROR("VPN Provider Type not present", service_path); | 76 NET_LOG_ERROR("VPN Provider Type not present", service_path); |
77 return false; | 77 return false; |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 const network_handler::ErrorCallback& error_callback, | 595 const network_handler::ErrorCallback& error_callback, |
596 const std::string& error_name, | 596 const std::string& error_name, |
597 const std::string& error_message) { | 597 const std::string& error_message) { |
598 std::string error = | 598 std::string error = |
599 "Disconnect Failure: " + error_name + ": " + error_message; | 599 "Disconnect Failure: " + error_name + ": " + error_message; |
600 network_handler::ShillErrorCallbackFunction( | 600 network_handler::ShillErrorCallbackFunction( |
601 service_path, error_callback, error_name, error_message); | 601 service_path, error_callback, error_name, error_message); |
602 } | 602 } |
603 | 603 |
604 } // namespace chromeos | 604 } // namespace chromeos |
OLD | NEW |