| 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 "base/threading/worker_pool.h" |
| 8 #include "chromeos/dbus/dbus_thread_manager.h" | 8 #include "chromeos/dbus/dbus_thread_manager.h" |
| 9 #include "chromeos/network/auto_connect_handler.h" | 9 #include "chromeos/network/auto_connect_handler.h" |
| 10 #include "chromeos/network/client_cert_resolver.h" | 10 #include "chromeos/network/client_cert_resolver.h" |
| 11 #include "chromeos/network/geolocation_handler.h" | 11 #include "chromeos/network/geolocation_handler.h" |
| 12 #include "chromeos/network/managed_network_configuration_handler_impl.h" | 12 #include "chromeos/network/managed_network_configuration_handler_impl.h" |
| 13 #include "chromeos/network/network_activation_handler.h" | 13 #include "chromeos/network/network_activation_handler.h" |
| 14 #include "chromeos/network/network_cert_migrator.h" | 14 #include "chromeos/network/network_cert_migrator.h" |
| 15 #include "chromeos/network/network_configuration_handler.h" | 15 #include "chromeos/network/network_configuration_handler.h" |
| 16 #include "chromeos/network/network_connection_handler.h" | 16 #include "chromeos/network/network_connection_handler.h" |
| 17 #include "chromeos/network/network_device_handler_impl.h" | 17 #include "chromeos/network/network_device_handler_impl.h" |
| 18 #include "chromeos/network/network_event_log.h" | |
| 19 #include "chromeos/network/network_profile_handler.h" | 18 #include "chromeos/network/network_profile_handler.h" |
| 20 #include "chromeos/network/network_profile_observer.h" | 19 #include "chromeos/network/network_profile_observer.h" |
| 21 #include "chromeos/network/network_sms_handler.h" | 20 #include "chromeos/network/network_sms_handler.h" |
| 22 #include "chromeos/network/network_state_handler.h" | 21 #include "chromeos/network/network_state_handler.h" |
| 23 #include "chromeos/network/network_state_handler_observer.h" | 22 #include "chromeos/network/network_state_handler_observer.h" |
| 24 | 23 |
| 25 namespace chromeos { | 24 namespace chromeos { |
| 26 | 25 |
| 27 static NetworkHandler* g_network_handler = NULL; | 26 static NetworkHandler* g_network_handler = NULL; |
| 28 | 27 |
| 29 NetworkHandler::NetworkHandler() | 28 NetworkHandler::NetworkHandler() |
| 30 : message_loop_(base::MessageLoopProxy::current()) { | 29 : message_loop_(base::MessageLoopProxy::current()) { |
| 31 CHECK(DBusThreadManager::IsInitialized()); | 30 CHECK(DBusThreadManager::IsInitialized()); |
| 32 | 31 |
| 33 network_event_log::Initialize(); | |
| 34 | |
| 35 network_state_handler_.reset(new NetworkStateHandler()); | 32 network_state_handler_.reset(new NetworkStateHandler()); |
| 36 network_device_handler_.reset(new NetworkDeviceHandlerImpl()); | 33 network_device_handler_.reset(new NetworkDeviceHandlerImpl()); |
| 37 network_profile_handler_.reset(new NetworkProfileHandler()); | 34 network_profile_handler_.reset(new NetworkProfileHandler()); |
| 38 network_configuration_handler_.reset(new NetworkConfigurationHandler()); | 35 network_configuration_handler_.reset(new NetworkConfigurationHandler()); |
| 39 managed_network_configuration_handler_.reset( | 36 managed_network_configuration_handler_.reset( |
| 40 new ManagedNetworkConfigurationHandlerImpl()); | 37 new ManagedNetworkConfigurationHandlerImpl()); |
| 41 if (CertLoader::IsInitialized()) { | 38 if (CertLoader::IsInitialized()) { |
| 42 auto_connect_handler_.reset(new AutoConnectHandler()); | 39 auto_connect_handler_.reset(new AutoConnectHandler()); |
| 43 network_cert_migrator_.reset(new NetworkCertMigrator()); | 40 network_cert_migrator_.reset(new NetworkCertMigrator()); |
| 44 client_cert_resolver_.reset(new ClientCertResolver()); | 41 client_cert_resolver_.reset(new ClientCertResolver()); |
| 45 } | 42 } |
| 46 network_activation_handler_.reset(new NetworkActivationHandler()); | 43 network_activation_handler_.reset(new NetworkActivationHandler()); |
| 47 network_connection_handler_.reset(new NetworkConnectionHandler()); | 44 network_connection_handler_.reset(new NetworkConnectionHandler()); |
| 48 network_sms_handler_.reset(new NetworkSmsHandler()); | 45 network_sms_handler_.reset(new NetworkSmsHandler()); |
| 49 geolocation_handler_.reset(new GeolocationHandler()); | 46 geolocation_handler_.reset(new GeolocationHandler()); |
| 50 } | 47 } |
| 51 | 48 |
| 52 NetworkHandler::~NetworkHandler() { | 49 NetworkHandler::~NetworkHandler() { |
| 53 network_event_log::Shutdown(); | |
| 54 } | 50 } |
| 55 | 51 |
| 56 void NetworkHandler::Init() { | 52 void NetworkHandler::Init() { |
| 57 network_state_handler_->InitShillPropertyHandler(); | 53 network_state_handler_->InitShillPropertyHandler(); |
| 58 network_device_handler_->Init(network_state_handler_.get()); | 54 network_device_handler_->Init(network_state_handler_.get()); |
| 59 network_profile_handler_->Init(); | 55 network_profile_handler_->Init(); |
| 60 network_configuration_handler_->Init(network_state_handler_.get()); | 56 network_configuration_handler_->Init(network_state_handler_.get()); |
| 61 managed_network_configuration_handler_->Init( | 57 managed_network_configuration_handler_->Init( |
| 62 network_state_handler_.get(), | 58 network_state_handler_.get(), |
| 63 network_profile_handler_.get(), | 59 network_profile_handler_.get(), |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 136 |
| 141 NetworkSmsHandler* NetworkHandler::network_sms_handler() { | 137 NetworkSmsHandler* NetworkHandler::network_sms_handler() { |
| 142 return network_sms_handler_.get(); | 138 return network_sms_handler_.get(); |
| 143 } | 139 } |
| 144 | 140 |
| 145 GeolocationHandler* NetworkHandler::geolocation_handler() { | 141 GeolocationHandler* NetworkHandler::geolocation_handler() { |
| 146 return geolocation_handler_.get(); | 142 return geolocation_handler_.get(); |
| 147 } | 143 } |
| 148 | 144 |
| 149 } // namespace chromeos | 145 } // namespace chromeos |
| OLD | NEW |