| 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 "ui/chromeos/network/network_connect.h" | 5 #include "ui/chromeos/network/network_connect.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void OnConnectSucceeded(const std::string& service_path); | 92 void OnConnectSucceeded(const std::string& service_path); |
| 93 void CallConnectToNetwork(const std::string& service_path, | 93 void CallConnectToNetwork(const std::string& service_path, |
| 94 bool check_error_state); | 94 bool check_error_state); |
| 95 void OnActivateFailed(const std::string& service_path, | 95 void OnActivateFailed(const std::string& service_path, |
| 96 const std::string& error_name, | 96 const std::string& error_name, |
| 97 scoped_ptr<base::DictionaryValue> error_data); | 97 scoped_ptr<base::DictionaryValue> error_data); |
| 98 void OnActivateSucceeded(const std::string& service_path); | 98 void OnActivateSucceeded(const std::string& service_path); |
| 99 void OnConfigureFailed(const std::string& error_name, | 99 void OnConfigureFailed(const std::string& error_name, |
| 100 scoped_ptr<base::DictionaryValue> error_data); | 100 scoped_ptr<base::DictionaryValue> error_data); |
| 101 void OnConfigureSucceeded(bool connect_on_configure, | 101 void OnConfigureSucceeded(bool connect_on_configure, |
| 102 const std::string& service_path); | 102 const std::string& service_path, |
| 103 const std::string& guid); |
| 103 void CallCreateConfiguration(base::DictionaryValue* properties, | 104 void CallCreateConfiguration(base::DictionaryValue* properties, |
| 104 bool shared, | 105 bool shared, |
| 105 bool connect_on_configure); | 106 bool connect_on_configure); |
| 106 void SetPropertiesFailed(const std::string& desc, | 107 void SetPropertiesFailed(const std::string& desc, |
| 107 const std::string& service_path, | 108 const std::string& service_path, |
| 108 const std::string& config_error_name, | 109 const std::string& config_error_name, |
| 109 scoped_ptr<base::DictionaryValue> error_data); | 110 scoped_ptr<base::DictionaryValue> error_data); |
| 110 void SetPropertiesToClear(base::DictionaryValue* properties_to_set, | 111 void SetPropertiesToClear(base::DictionaryValue* properties_to_set, |
| 111 std::vector<std::string>* properties_to_clear); | 112 std::vector<std::string>* properties_to_clear); |
| 112 void ClearPropertiesAndConnect( | 113 void ClearPropertiesAndConnect( |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 278 |
| 278 void NetworkConnectImpl::OnConfigureFailed( | 279 void NetworkConnectImpl::OnConfigureFailed( |
| 279 const std::string& error_name, | 280 const std::string& error_name, |
| 280 scoped_ptr<base::DictionaryValue> error_data) { | 281 scoped_ptr<base::DictionaryValue> error_data) { |
| 281 NET_LOG_ERROR("Unable to configure network", ""); | 282 NET_LOG_ERROR("Unable to configure network", ""); |
| 282 network_state_notifier_->ShowNetworkConnectError( | 283 network_state_notifier_->ShowNetworkConnectError( |
| 283 NetworkConnectionHandler::kErrorConfigureFailed, ""); | 284 NetworkConnectionHandler::kErrorConfigureFailed, ""); |
| 284 } | 285 } |
| 285 | 286 |
| 286 void NetworkConnectImpl::OnConfigureSucceeded(bool connect_on_configure, | 287 void NetworkConnectImpl::OnConfigureSucceeded(bool connect_on_configure, |
| 287 const std::string& service_path) { | 288 const std::string& service_path, |
| 289 const std::string& guid) { |
| 288 NET_LOG_USER("Configure Succeeded", service_path); | 290 NET_LOG_USER("Configure Succeeded", service_path); |
| 289 if (!connect_on_configure) | 291 if (!connect_on_configure) |
| 290 return; | 292 return; |
| 291 // After configuring a network, ignore any (possibly stale) error state. | 293 // After configuring a network, ignore any (possibly stale) error state. |
| 292 const bool check_error_state = false; | 294 const bool check_error_state = false; |
| 293 CallConnectToNetwork(service_path, check_error_state); | 295 CallConnectToNetwork(service_path, check_error_state); |
| 294 } | 296 } |
| 295 | 297 |
| 296 void NetworkConnectImpl::CallCreateConfiguration( | 298 void NetworkConnectImpl::CallCreateConfiguration( |
| 297 base::DictionaryValue* shill_properties, | 299 base::DictionaryValue* shill_properties, |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 return g_network_connect; | 650 return g_network_connect; |
| 649 } | 651 } |
| 650 | 652 |
| 651 NetworkConnect::NetworkConnect() { | 653 NetworkConnect::NetworkConnect() { |
| 652 } | 654 } |
| 653 | 655 |
| 654 NetworkConnect::~NetworkConnect() { | 656 NetworkConnect::~NetworkConnect() { |
| 655 } | 657 } |
| 656 | 658 |
| 657 } // namespace ui | 659 } // namespace ui |
| OLD | NEW |