| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_configuration_handler.h" | 5 #include "chromeos/network/network_configuration_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 "Config.CreateConfiguration Failed", "", error_callback)); | 328 "Config.CreateConfiguration Failed", "", error_callback)); |
| 329 } | 329 } |
| 330 | 330 |
| 331 void NetworkConfigurationHandler::RemoveConfiguration( | 331 void NetworkConfigurationHandler::RemoveConfiguration( |
| 332 const std::string& service_path, | 332 const std::string& service_path, |
| 333 NetworkConfigurationObserver::Source source, | 333 NetworkConfigurationObserver::Source source, |
| 334 const base::Closure& callback, | 334 const base::Closure& callback, |
| 335 const network_handler::ErrorCallback& error_callback) { | 335 const network_handler::ErrorCallback& error_callback) { |
| 336 // Service.Remove is not reliable. Instead, request the profile entries | 336 // Service.Remove is not reliable. Instead, request the profile entries |
| 337 // for the service and remove each entry. | 337 // for the service and remove each entry. |
| 338 if (ContainsKey(profile_entry_deleters_, service_path)) { | 338 if (base::ContainsKey(profile_entry_deleters_, service_path)) { |
| 339 InvokeErrorCallback(service_path, error_callback, | 339 InvokeErrorCallback(service_path, error_callback, |
| 340 "RemoveConfigurationInProgress"); | 340 "RemoveConfigurationInProgress"); |
| 341 return; | 341 return; |
| 342 } | 342 } |
| 343 | 343 |
| 344 std::string guid; | 344 std::string guid; |
| 345 const NetworkState* network_state = | 345 const NetworkState* network_state = |
| 346 network_state_handler_->GetNetworkState(service_path); | 346 network_state_handler_->GetNetworkState(service_path); |
| 347 if (network_state) | 347 if (network_state) |
| 348 guid = network_state->guid(); | 348 guid = network_state->guid(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 371 error_callback)); | 371 error_callback)); |
| 372 } | 372 } |
| 373 | 373 |
| 374 // NetworkConfigurationHandler Private methods | 374 // NetworkConfigurationHandler Private methods |
| 375 | 375 |
| 376 NetworkConfigurationHandler::NetworkConfigurationHandler() | 376 NetworkConfigurationHandler::NetworkConfigurationHandler() |
| 377 : network_state_handler_(NULL) { | 377 : network_state_handler_(NULL) { |
| 378 } | 378 } |
| 379 | 379 |
| 380 NetworkConfigurationHandler::~NetworkConfigurationHandler() { | 380 NetworkConfigurationHandler::~NetworkConfigurationHandler() { |
| 381 STLDeleteContainerPairSecondPointers(profile_entry_deleters_.begin(), | 381 base::STLDeleteContainerPairSecondPointers(profile_entry_deleters_.begin(), |
| 382 profile_entry_deleters_.end()); | 382 profile_entry_deleters_.end()); |
| 383 } | 383 } |
| 384 | 384 |
| 385 void NetworkConfigurationHandler::Init( | 385 void NetworkConfigurationHandler::Init( |
| 386 NetworkStateHandler* network_state_handler, | 386 NetworkStateHandler* network_state_handler, |
| 387 NetworkDeviceHandler* network_device_handler) { | 387 NetworkDeviceHandler* network_device_handler) { |
| 388 network_state_handler_ = network_state_handler; | 388 network_state_handler_ = network_state_handler; |
| 389 network_device_handler_ = network_device_handler; | 389 network_device_handler_ = network_device_handler; |
| 390 } | 390 } |
| 391 | 391 |
| 392 void NetworkConfigurationHandler::RunCreateNetworkCallback( | 392 void NetworkConfigurationHandler::RunCreateNetworkCallback( |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 // static | 562 // static |
| 563 NetworkConfigurationHandler* NetworkConfigurationHandler::InitializeForTest( | 563 NetworkConfigurationHandler* NetworkConfigurationHandler::InitializeForTest( |
| 564 NetworkStateHandler* network_state_handler, | 564 NetworkStateHandler* network_state_handler, |
| 565 NetworkDeviceHandler* network_device_handler) { | 565 NetworkDeviceHandler* network_device_handler) { |
| 566 NetworkConfigurationHandler* handler = new NetworkConfigurationHandler(); | 566 NetworkConfigurationHandler* handler = new NetworkConfigurationHandler(); |
| 567 handler->Init(network_state_handler, network_device_handler); | 567 handler->Init(network_state_handler, network_device_handler); |
| 568 return handler; | 568 return handler; |
| 569 } | 569 } |
| 570 | 570 |
| 571 } // namespace chromeos | 571 } // namespace chromeos |
| OLD | NEW |