| 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/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "base/threading/worker_pool.h" | 8 #include "base/threading/worker_pool.h" |
| 9 #include "chromeos/dbus/dbus_thread_manager.h" | 9 #include "chromeos/dbus/dbus_thread_manager.h" |
| 10 #include "chromeos/network/auto_connect_handler.h" | 10 #include "chromeos/network/auto_connect_handler.h" |
| 11 #include "chromeos/network/client_cert_resolver.h" | 11 #include "chromeos/network/client_cert_resolver.h" |
| 12 #include "chromeos/network/geolocation_handler.h" | 12 #include "chromeos/network/geolocation_handler.h" |
| 13 #include "chromeos/network/managed_network_configuration_handler_impl.h" | 13 #include "chromeos/network/managed_network_configuration_handler_impl.h" |
| 14 #include "chromeos/network/network_activation_handler.h" | 14 #include "chromeos/network/network_activation_handler.h" |
| 15 #include "chromeos/network/network_cert_migrator.h" | 15 #include "chromeos/network/network_cert_migrator.h" |
| 16 #include "chromeos/network/network_configuration_handler.h" | 16 #include "chromeos/network/network_configuration_handler.h" |
| 17 #include "chromeos/network/network_connection_handler.h" | 17 #include "chromeos/network/network_connection_handler.h" |
| 18 #include "chromeos/network/network_device_handler_impl.h" | 18 #include "chromeos/network/network_device_handler_impl.h" |
| 19 #include "chromeos/network/network_profile_handler.h" | 19 #include "chromeos/network/network_profile_handler.h" |
| 20 #include "chromeos/network/network_profile_observer.h" | 20 #include "chromeos/network/network_profile_observer.h" |
| 21 #include "chromeos/network/network_sms_handler.h" | 21 #include "chromeos/network/network_sms_handler.h" |
| 22 #include "chromeos/network/network_state_handler.h" | 22 #include "chromeos/network/network_state_handler.h" |
| 23 #include "chromeos/network/network_state_handler_observer.h" | 23 #include "chromeos/network/network_state_handler_observer.h" |
| 24 #include "chromeos/network/prohibited_technologies_handler.h" |
| 24 | 25 |
| 25 namespace chromeos { | 26 namespace chromeos { |
| 26 | 27 |
| 27 static NetworkHandler* g_network_handler = NULL; | 28 static NetworkHandler* g_network_handler = NULL; |
| 28 | 29 |
| 29 NetworkHandler::NetworkHandler() | 30 NetworkHandler::NetworkHandler() |
| 30 : task_runner_(base::ThreadTaskRunnerHandle::Get()) { | 31 : task_runner_(base::ThreadTaskRunnerHandle::Get()) { |
| 31 CHECK(DBusThreadManager::IsInitialized()); | 32 CHECK(DBusThreadManager::IsInitialized()); |
| 32 | 33 |
| 33 network_state_handler_.reset(new NetworkStateHandler()); | 34 network_state_handler_.reset(new NetworkStateHandler()); |
| 34 network_device_handler_.reset(new NetworkDeviceHandlerImpl()); | 35 network_device_handler_.reset(new NetworkDeviceHandlerImpl()); |
| 35 network_profile_handler_.reset(new NetworkProfileHandler()); | 36 network_profile_handler_.reset(new NetworkProfileHandler()); |
| 36 network_configuration_handler_.reset(new NetworkConfigurationHandler()); | 37 network_configuration_handler_.reset(new NetworkConfigurationHandler()); |
| 37 managed_network_configuration_handler_.reset( | 38 managed_network_configuration_handler_.reset( |
| 38 new ManagedNetworkConfigurationHandlerImpl()); | 39 new ManagedNetworkConfigurationHandlerImpl()); |
| 40 prohibited_technologies_handler_.reset(new ProhibitedTechnologiesHandler()); |
| 39 if (CertLoader::IsInitialized()) { | 41 if (CertLoader::IsInitialized()) { |
| 40 auto_connect_handler_.reset(new AutoConnectHandler()); | 42 auto_connect_handler_.reset(new AutoConnectHandler()); |
| 41 network_cert_migrator_.reset(new NetworkCertMigrator()); | 43 network_cert_migrator_.reset(new NetworkCertMigrator()); |
| 42 client_cert_resolver_.reset(new ClientCertResolver()); | 44 client_cert_resolver_.reset(new ClientCertResolver()); |
| 43 } | 45 } |
| 44 network_activation_handler_.reset(new NetworkActivationHandler()); | 46 network_activation_handler_.reset(new NetworkActivationHandler()); |
| 45 network_connection_handler_.reset(new NetworkConnectionHandler()); | 47 network_connection_handler_.reset(new NetworkConnectionHandler()); |
| 46 network_sms_handler_.reset(new NetworkSmsHandler()); | 48 network_sms_handler_.reset(new NetworkSmsHandler()); |
| 47 geolocation_handler_.reset(new GeolocationHandler()); | 49 geolocation_handler_.reset(new GeolocationHandler()); |
| 48 } | 50 } |
| 49 | 51 |
| 50 NetworkHandler::~NetworkHandler() { | 52 NetworkHandler::~NetworkHandler() { |
| 51 } | 53 } |
| 52 | 54 |
| 53 void NetworkHandler::Init() { | 55 void NetworkHandler::Init() { |
| 54 network_state_handler_->InitShillPropertyHandler(); | 56 network_state_handler_->InitShillPropertyHandler(); |
| 55 network_device_handler_->Init(network_state_handler_.get()); | 57 network_device_handler_->Init(network_state_handler_.get()); |
| 56 network_profile_handler_->Init(); | 58 network_profile_handler_->Init(); |
| 57 network_configuration_handler_->Init(network_state_handler_.get(), | 59 network_configuration_handler_->Init(network_state_handler_.get(), |
| 58 network_device_handler_.get()); | 60 network_device_handler_.get()); |
| 59 managed_network_configuration_handler_->Init( | 61 managed_network_configuration_handler_->Init( |
| 60 network_state_handler_.get(), | 62 network_state_handler_.get(), network_profile_handler_.get(), |
| 61 network_profile_handler_.get(), | 63 network_configuration_handler_.get(), network_device_handler_.get(), |
| 62 network_configuration_handler_.get(), | 64 prohibited_technologies_handler_.get()); |
| 63 network_device_handler_.get()); | |
| 64 network_connection_handler_->Init( | 65 network_connection_handler_->Init( |
| 65 network_state_handler_.get(), | 66 network_state_handler_.get(), |
| 66 network_configuration_handler_.get(), | 67 network_configuration_handler_.get(), |
| 67 managed_network_configuration_handler_.get()); | 68 managed_network_configuration_handler_.get()); |
| 68 if (network_cert_migrator_) | 69 if (network_cert_migrator_) |
| 69 network_cert_migrator_->Init(network_state_handler_.get()); | 70 network_cert_migrator_->Init(network_state_handler_.get()); |
| 70 if (client_cert_resolver_) { | 71 if (client_cert_resolver_) { |
| 71 client_cert_resolver_->Init(network_state_handler_.get(), | 72 client_cert_resolver_->Init(network_state_handler_.get(), |
| 72 managed_network_configuration_handler_.get()); | 73 managed_network_configuration_handler_.get()); |
| 73 } | 74 } |
| 74 if (auto_connect_handler_) { | 75 if (auto_connect_handler_) { |
| 75 auto_connect_handler_->Init(client_cert_resolver_.get(), | 76 auto_connect_handler_->Init(client_cert_resolver_.get(), |
| 76 network_connection_handler_.get(), | 77 network_connection_handler_.get(), |
| 77 network_state_handler_.get(), | 78 network_state_handler_.get(), |
| 78 managed_network_configuration_handler_.get()); | 79 managed_network_configuration_handler_.get()); |
| 79 } | 80 } |
| 81 prohibited_technologies_handler_->Init( |
| 82 managed_network_configuration_handler_.get(), |
| 83 network_state_handler_.get()); |
| 80 network_sms_handler_->Init(); | 84 network_sms_handler_->Init(); |
| 81 geolocation_handler_->Init(); | 85 geolocation_handler_->Init(); |
| 82 } | 86 } |
| 83 | 87 |
| 84 // static | 88 // static |
| 85 void NetworkHandler::Initialize() { | 89 void NetworkHandler::Initialize() { |
| 86 CHECK(!g_network_handler); | 90 CHECK(!g_network_handler); |
| 87 g_network_handler = new NetworkHandler(); | 91 g_network_handler = new NetworkHandler(); |
| 88 g_network_handler->Init(); | 92 g_network_handler->Init(); |
| 89 } | 93 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 141 } |
| 138 | 142 |
| 139 NetworkSmsHandler* NetworkHandler::network_sms_handler() { | 143 NetworkSmsHandler* NetworkHandler::network_sms_handler() { |
| 140 return network_sms_handler_.get(); | 144 return network_sms_handler_.get(); |
| 141 } | 145 } |
| 142 | 146 |
| 143 GeolocationHandler* NetworkHandler::geolocation_handler() { | 147 GeolocationHandler* NetworkHandler::geolocation_handler() { |
| 144 return geolocation_handler_.get(); | 148 return geolocation_handler_.get(); |
| 145 } | 149 } |
| 146 | 150 |
| 151 ProhibitedTechnologiesHandler* |
| 152 NetworkHandler::prohibited_technologies_handler() { |
| 153 return prohibited_technologies_handler_.get(); |
| 154 } |
| 155 |
| 147 } // namespace chromeos | 156 } // namespace chromeos |
| OLD | NEW |