| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 void CopyStringFromDictionary(const base::DictionaryValue& source, | 50 void CopyStringFromDictionary(const base::DictionaryValue& source, |
| 51 const std::string& key, | 51 const std::string& key, |
| 52 base::DictionaryValue* dest) { | 52 base::DictionaryValue* dest) { |
| 53 std::string string_value; | 53 std::string string_value; |
| 54 if (source.GetStringWithoutPathExpansion(key, &string_value)) | 54 if (source.GetStringWithoutPathExpansion(key, &string_value)) |
| 55 dest->SetStringWithoutPathExpansion(key, string_value); | 55 dest->SetStringWithoutPathExpansion(key, string_value); |
| 56 } | 56 } |
| 57 | 57 |
| 58 bool NetworkRequiresActivation(const NetworkState* network) { | 58 bool NetworkRequiresActivation(const NetworkState* network) { |
| 59 return (network->type() == flimflam::kTypeCellular && | 59 return (network->type() == flimflam::kTypeCellular && |
| 60 (network->activation_state() != flimflam::kActivationStateActivated || | 60 ((network->activation_state() != flimflam::kActivationStateActivated && |
| 61 network->cellular_out_of_credits())); | 61 network->activation_state() != flimflam::kActivationStateUnknown) || |
| 62 network->cellular_out_of_credits())); |
| 62 } | 63 } |
| 63 | 64 |
| 64 bool VPNIsConfigured(const std::string& service_path, | 65 bool VPNIsConfigured(const std::string& service_path, |
| 65 const std::string& provider_type, | 66 const std::string& provider_type, |
| 66 const base::DictionaryValue& provider_properties) { | 67 const base::DictionaryValue& provider_properties) { |
| 67 if (provider_type == flimflam::kProviderOpenVpn) { | 68 if (provider_type == flimflam::kProviderOpenVpn) { |
| 68 std::string hostname; | 69 std::string hostname; |
| 69 provider_properties.GetStringWithoutPathExpansion( | 70 provider_properties.GetStringWithoutPathExpansion( |
| 70 flimflam::kHostProperty, &hostname); | 71 flimflam::kHostProperty, &hostname); |
| 71 if (hostname.empty()) { | 72 if (hostname.empty()) { |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 | 716 |
| 716 void NetworkConnectionHandler::HandleShillActivateSuccess( | 717 void NetworkConnectionHandler::HandleShillActivateSuccess( |
| 717 const std::string& service_path, | 718 const std::string& service_path, |
| 718 const base::Closure& success_callback) { | 719 const base::Closure& success_callback) { |
| 719 NET_LOG_EVENT("Activate Request Sent", service_path); | 720 NET_LOG_EVENT("Activate Request Sent", service_path); |
| 720 if (!success_callback.is_null()) | 721 if (!success_callback.is_null()) |
| 721 success_callback.Run(); | 722 success_callback.Run(); |
| 722 } | 723 } |
| 723 | 724 |
| 724 } // namespace chromeos | 725 } // namespace chromeos |
| OLD | NEW |