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/client_cert_resolver.h" | 10 #include "chromeos/network/client_cert_resolver.h" |
10 #include "chromeos/network/geolocation_handler.h" | 11 #include "chromeos/network/geolocation_handler.h" |
11 #include "chromeos/network/managed_network_configuration_handler_impl.h" | 12 #include "chromeos/network/managed_network_configuration_handler_impl.h" |
12 #include "chromeos/network/network_activation_handler.h" | 13 #include "chromeos/network/network_activation_handler.h" |
13 #include "chromeos/network/network_cert_migrator.h" | 14 #include "chromeos/network/network_cert_migrator.h" |
14 #include "chromeos/network/network_configuration_handler.h" | 15 #include "chromeos/network/network_configuration_handler.h" |
15 #include "chromeos/network/network_connection_handler.h" | 16 #include "chromeos/network/network_connection_handler.h" |
16 #include "chromeos/network/network_device_handler_impl.h" | 17 #include "chromeos/network/network_device_handler_impl.h" |
17 #include "chromeos/network/network_event_log.h" | 18 #include "chromeos/network/network_event_log.h" |
18 #include "chromeos/network/network_profile_handler.h" | 19 #include "chromeos/network/network_profile_handler.h" |
(...skipping 12 matching lines...) Expand all Loading... |
31 | 32 |
32 network_event_log::Initialize(); | 33 network_event_log::Initialize(); |
33 | 34 |
34 network_state_handler_.reset(new NetworkStateHandler()); | 35 network_state_handler_.reset(new NetworkStateHandler()); |
35 network_device_handler_.reset(new NetworkDeviceHandlerImpl()); | 36 network_device_handler_.reset(new NetworkDeviceHandlerImpl()); |
36 network_profile_handler_.reset(new NetworkProfileHandler()); | 37 network_profile_handler_.reset(new NetworkProfileHandler()); |
37 network_configuration_handler_.reset(new NetworkConfigurationHandler()); | 38 network_configuration_handler_.reset(new NetworkConfigurationHandler()); |
38 managed_network_configuration_handler_.reset( | 39 managed_network_configuration_handler_.reset( |
39 new ManagedNetworkConfigurationHandlerImpl()); | 40 new ManagedNetworkConfigurationHandlerImpl()); |
40 if (CertLoader::IsInitialized()) { | 41 if (CertLoader::IsInitialized()) { |
| 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() { |
(...skipping 13 matching lines...) Expand all Loading... |
64 network_connection_handler_->Init( | 66 network_connection_handler_->Init( |
65 network_state_handler_.get(), | 67 network_state_handler_.get(), |
66 network_configuration_handler_.get(), | 68 network_configuration_handler_.get(), |
67 managed_network_configuration_handler_.get()); | 69 managed_network_configuration_handler_.get()); |
68 if (network_cert_migrator_) | 70 if (network_cert_migrator_) |
69 network_cert_migrator_->Init(network_state_handler_.get()); | 71 network_cert_migrator_->Init(network_state_handler_.get()); |
70 if (client_cert_resolver_) { | 72 if (client_cert_resolver_) { |
71 client_cert_resolver_->Init(network_state_handler_.get(), | 73 client_cert_resolver_->Init(network_state_handler_.get(), |
72 managed_network_configuration_handler_.get()); | 74 managed_network_configuration_handler_.get()); |
73 } | 75 } |
| 76 if (auto_connect_handler_) { |
| 77 auto_connect_handler_->Init(client_cert_resolver_.get(), |
| 78 network_connection_handler_.get(), |
| 79 network_state_handler_.get(), |
| 80 managed_network_configuration_handler_.get()); |
| 81 } |
74 network_sms_handler_->Init(); | 82 network_sms_handler_->Init(); |
75 geolocation_handler_->Init(); | 83 geolocation_handler_->Init(); |
76 } | 84 } |
77 | 85 |
78 // static | 86 // static |
79 void NetworkHandler::Initialize() { | 87 void NetworkHandler::Initialize() { |
80 CHECK(!g_network_handler); | 88 CHECK(!g_network_handler); |
81 g_network_handler = new NetworkHandler(); | 89 g_network_handler = new NetworkHandler(); |
82 g_network_handler->Init(); | 90 g_network_handler->Init(); |
83 } | 91 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 140 |
133 NetworkSmsHandler* NetworkHandler::network_sms_handler() { | 141 NetworkSmsHandler* NetworkHandler::network_sms_handler() { |
134 return network_sms_handler_.get(); | 142 return network_sms_handler_.get(); |
135 } | 143 } |
136 | 144 |
137 GeolocationHandler* NetworkHandler::geolocation_handler() { | 145 GeolocationHandler* NetworkHandler::geolocation_handler() { |
138 return geolocation_handler_.get(); | 146 return geolocation_handler_.get(); |
139 } | 147 } |
140 | 148 |
141 } // namespace chromeos | 149 } // namespace chromeos |
OLD | NEW |