Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Side by Side Diff: chromeos/network/network_handler.cc

Issue 12669004: Fix NetworkSmsHandler to observe Manager and improve API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/network/network_handler.h ('k') | chromeos/network/network_sms_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chromeos/dbus/dbus_thread_manager.h" 7 #include "chromeos/dbus/dbus_thread_manager.h"
8 #include "chromeos/network/geolocation_handler.h" 8 #include "chromeos/network/geolocation_handler.h"
9 #include "chromeos/network/managed_network_configuration_handler.h" 9 #include "chromeos/network/managed_network_configuration_handler.h"
10 #include "chromeos/network/network_configuration_handler.h" 10 #include "chromeos/network/network_configuration_handler.h"
11 #include "chromeos/network/network_connection_handler.h" 11 #include "chromeos/network/network_connection_handler.h"
12 #include "chromeos/network/network_device_handler.h" 12 #include "chromeos/network/network_device_handler.h"
13 #include "chromeos/network/network_event_log.h" 13 #include "chromeos/network/network_event_log.h"
14 #include "chromeos/network/network_profile_handler.h" 14 #include "chromeos/network/network_profile_handler.h"
15 #include "chromeos/network/network_profile_observer.h" 15 #include "chromeos/network/network_profile_observer.h"
16 #include "chromeos/network/network_sms_handler.h"
16 #include "chromeos/network/network_state_handler.h" 17 #include "chromeos/network/network_state_handler.h"
17 #include "chromeos/network/network_state_handler_observer.h" 18 #include "chromeos/network/network_state_handler_observer.h"
18 19
19 namespace chromeos { 20 namespace chromeos {
20 21
21 static NetworkHandler* g_network_handler = NULL; 22 static NetworkHandler* g_network_handler = NULL;
22 23
23 NetworkHandler::NetworkHandler() { 24 NetworkHandler::NetworkHandler() {
24 CHECK(DBusThreadManager::IsInitialized()); 25 CHECK(DBusThreadManager::IsInitialized());
25 26
26 network_event_log::Initialize(); 27 network_event_log::Initialize();
27 28
28 network_state_handler_.reset(new NetworkStateHandler()); 29 network_state_handler_.reset(new NetworkStateHandler());
29 network_device_handler_.reset(new NetworkDeviceHandler()); 30 network_device_handler_.reset(new NetworkDeviceHandler());
30 network_profile_handler_.reset(new NetworkProfileHandler()); 31 network_profile_handler_.reset(new NetworkProfileHandler());
31 network_configuration_handler_.reset(new NetworkConfigurationHandler()); 32 network_configuration_handler_.reset(new NetworkConfigurationHandler());
32 managed_network_configuration_handler_.reset( 33 managed_network_configuration_handler_.reset(
33 new ManagedNetworkConfigurationHandler()); 34 new ManagedNetworkConfigurationHandler());
34 network_connection_handler_.reset(new NetworkConnectionHandler()); 35 network_connection_handler_.reset(new NetworkConnectionHandler());
36 network_sms_handler_.reset(new NetworkSmsHandler());
35 geolocation_handler_.reset(new GeolocationHandler()); 37 geolocation_handler_.reset(new GeolocationHandler());
36 } 38 }
37 39
38 NetworkHandler::~NetworkHandler() { 40 NetworkHandler::~NetworkHandler() {
39 network_event_log::Shutdown(); 41 network_event_log::Shutdown();
40 } 42 }
41 43
42 void NetworkHandler::Init() { 44 void NetworkHandler::Init() {
43 network_state_handler_->InitShillPropertyHandler(); 45 network_state_handler_->InitShillPropertyHandler();
44 network_profile_handler_->Init(network_state_handler_.get()); 46 network_profile_handler_->Init(network_state_handler_.get());
45 network_configuration_handler_->Init(network_state_handler_.get()); 47 network_configuration_handler_->Init(network_state_handler_.get());
46 managed_network_configuration_handler_->Init( 48 managed_network_configuration_handler_->Init(
47 network_state_handler_.get(), 49 network_state_handler_.get(),
48 network_profile_handler_.get(), 50 network_profile_handler_.get(),
49 network_configuration_handler_.get()); 51 network_configuration_handler_.get());
50 network_connection_handler_->Init(network_state_handler_.get(), 52 network_connection_handler_->Init(network_state_handler_.get(),
51 network_configuration_handler_.get()); 53 network_configuration_handler_.get());
54 network_sms_handler_->Init();
52 geolocation_handler_->Init(); 55 geolocation_handler_->Init();
53 } 56 }
54 57
55 // static 58 // static
56 void NetworkHandler::Initialize() { 59 void NetworkHandler::Initialize() {
57 CHECK(!g_network_handler); 60 CHECK(!g_network_handler);
58 g_network_handler = new NetworkHandler(); 61 g_network_handler = new NetworkHandler();
59 g_network_handler->Init(); 62 g_network_handler->Init();
60 } 63 }
61 64
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 99
97 ManagedNetworkConfigurationHandler* 100 ManagedNetworkConfigurationHandler*
98 NetworkHandler::managed_network_configuration_handler() { 101 NetworkHandler::managed_network_configuration_handler() {
99 return managed_network_configuration_handler_.get(); 102 return managed_network_configuration_handler_.get();
100 } 103 }
101 104
102 NetworkConnectionHandler* NetworkHandler::network_connection_handler() { 105 NetworkConnectionHandler* NetworkHandler::network_connection_handler() {
103 return network_connection_handler_.get(); 106 return network_connection_handler_.get();
104 } 107 }
105 108
109 NetworkSmsHandler* NetworkHandler::network_sms_handler() {
110 return network_sms_handler_.get();
111 }
112
106 GeolocationHandler* NetworkHandler::geolocation_handler() { 113 GeolocationHandler* NetworkHandler::geolocation_handler() {
107 return geolocation_handler_.get(); 114 return geolocation_handler_.get();
108 } 115 }
109 116
110 } // namespace chromeos 117 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_handler.h ('k') | chromeos/network/network_sms_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698