| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_handler.h" | 5 #include "chromeos/network/network_handler.h" |
| 6 | 6 |
| 7 #include "base/threading/worker_pool.h" |
| 7 #include "chromeos/dbus/dbus_thread_manager.h" | 8 #include "chromeos/dbus/dbus_thread_manager.h" |
| 8 #include "chromeos/network/geolocation_handler.h" | 9 #include "chromeos/network/geolocation_handler.h" |
| 9 #include "chromeos/network/managed_network_configuration_handler.h" | 10 #include "chromeos/network/managed_network_configuration_handler.h" |
| 11 #include "chromeos/network/network_cert_migrator.h" |
| 10 #include "chromeos/network/network_configuration_handler.h" | 12 #include "chromeos/network/network_configuration_handler.h" |
| 11 #include "chromeos/network/network_connection_handler.h" | 13 #include "chromeos/network/network_connection_handler.h" |
| 12 #include "chromeos/network/network_device_handler.h" | 14 #include "chromeos/network/network_device_handler.h" |
| 13 #include "chromeos/network/network_event_log.h" | 15 #include "chromeos/network/network_event_log.h" |
| 14 #include "chromeos/network/network_profile_handler.h" | 16 #include "chromeos/network/network_profile_handler.h" |
| 15 #include "chromeos/network/network_profile_observer.h" | 17 #include "chromeos/network/network_profile_observer.h" |
| 16 #include "chromeos/network/network_state_handler.h" | 18 #include "chromeos/network/network_state_handler.h" |
| 17 #include "chromeos/network/network_state_handler_observer.h" | 19 #include "chromeos/network/network_state_handler_observer.h" |
| 18 | 20 |
| 19 namespace chromeos { | 21 namespace chromeos { |
| 20 | 22 |
| 21 static NetworkHandler* g_network_handler = NULL; | 23 static NetworkHandler* g_network_handler = NULL; |
| 22 | 24 |
| 23 NetworkHandler::NetworkHandler() { | 25 NetworkHandler::NetworkHandler() { |
| 24 CHECK(DBusThreadManager::IsInitialized()); | 26 CHECK(DBusThreadManager::IsInitialized()); |
| 25 | 27 |
| 26 network_event_log::Initialize(); | 28 network_event_log::Initialize(); |
| 27 | 29 |
| 28 network_state_handler_.reset(new NetworkStateHandler()); | 30 network_state_handler_.reset(new NetworkStateHandler()); |
| 29 network_device_handler_.reset(new NetworkDeviceHandler()); | 31 network_device_handler_.reset(new NetworkDeviceHandler()); |
| 30 network_profile_handler_.reset(new NetworkProfileHandler()); | 32 network_profile_handler_.reset(new NetworkProfileHandler()); |
| 33 network_cert_migrator_.reset(new NetworkCertMigrator()); |
| 31 network_configuration_handler_.reset(new NetworkConfigurationHandler()); | 34 network_configuration_handler_.reset(new NetworkConfigurationHandler()); |
| 32 managed_network_configuration_handler_.reset( | 35 managed_network_configuration_handler_.reset( |
| 33 new ManagedNetworkConfigurationHandler()); | 36 new ManagedNetworkConfigurationHandler()); |
| 34 network_connection_handler_.reset(new NetworkConnectionHandler()); | 37 network_connection_handler_.reset(new NetworkConnectionHandler()); |
| 35 geolocation_handler_.reset(new GeolocationHandler()); | 38 geolocation_handler_.reset(new GeolocationHandler()); |
| 36 } | 39 } |
| 37 | 40 |
| 38 NetworkHandler::~NetworkHandler() { | 41 NetworkHandler::~NetworkHandler() { |
| 39 network_event_log::Shutdown(); | 42 network_event_log::Shutdown(); |
| 40 } | 43 } |
| 41 | 44 |
| 42 void NetworkHandler::Init() { | 45 void NetworkHandler::Init() { |
| 43 network_state_handler_->InitShillPropertyHandler(); | 46 network_state_handler_->InitShillPropertyHandler(); |
| 44 network_profile_handler_->Init(network_state_handler_.get()); | 47 network_profile_handler_->Init(network_state_handler_.get()); |
| 48 network_cert_migrator_->Init(network_state_handler_.get()); |
| 45 network_configuration_handler_->Init(network_state_handler_.get()); | 49 network_configuration_handler_->Init(network_state_handler_.get()); |
| 46 managed_network_configuration_handler_->Init( | 50 managed_network_configuration_handler_->Init( |
| 47 network_state_handler_.get(), | 51 network_state_handler_.get(), |
| 48 network_profile_handler_.get(), | 52 network_profile_handler_.get(), |
| 49 network_configuration_handler_.get()); | 53 network_configuration_handler_.get()); |
| 50 network_connection_handler_->Init(network_state_handler_.get(), | 54 network_connection_handler_->Init(network_state_handler_.get(), |
| 51 network_configuration_handler_.get()); | 55 network_configuration_handler_.get()); |
| 52 geolocation_handler_->Init(); | 56 geolocation_handler_->Init(); |
| 53 } | 57 } |
| 54 | 58 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 105 |
| 102 NetworkConnectionHandler* NetworkHandler::network_connection_handler() { | 106 NetworkConnectionHandler* NetworkHandler::network_connection_handler() { |
| 103 return network_connection_handler_.get(); | 107 return network_connection_handler_.get(); |
| 104 } | 108 } |
| 105 | 109 |
| 106 GeolocationHandler* NetworkHandler::geolocation_handler() { | 110 GeolocationHandler* NetworkHandler::geolocation_handler() { |
| 107 return geolocation_handler_.get(); | 111 return geolocation_handler_.get(); |
| 108 } | 112 } |
| 109 | 113 |
| 110 } // namespace chromeos | 114 } // namespace chromeos |
| OLD | NEW |