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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 8423077: chromeos: Split NetworkChangeNotifierChromeos initialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix browser_tests Created 9 years, 1 month 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 | « no previous file | chrome/browser/chromeos/net/cros_network_change_notifier_factory.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "chrome/browser/chromeos/bluetooth/bluetooth_manager.h" 12 #include "chrome/browser/chromeos/bluetooth/bluetooth_manager.h"
13 #include "chrome/browser/chromeos/boot_times_loader.h" 13 #include "chrome/browser/chromeos/boot_times_loader.h"
14 #include "chrome/browser/chromeos/brightness_observer.h" 14 #include "chrome/browser/chromeos/brightness_observer.h"
15 #include "chrome/browser/chromeos/cros/cros_library.h" 15 #include "chrome/browser/chromeos/cros/cros_library.h"
16 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" 16 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
17 #include "chrome/browser/chromeos/dbus/session_manager_client.h" 17 #include "chrome/browser/chromeos/dbus/session_manager_client.h"
18 #include "chrome/browser/chromeos/login/session_manager_observer.h" 18 #include "chrome/browser/chromeos/login/session_manager_observer.h"
19 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" 19 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h"
20 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h"
20 #include "chrome/browser/chromeos/system/statistics_provider.h" 21 #include "chrome/browser/chromeos/system/statistics_provider.h"
21 #include "chrome/browser/defaults.h" 22 #include "chrome/browser/defaults.h"
22 #include "chrome/common/chrome_switches.h" 23 #include "chrome/common/chrome_switches.h"
23 #include "content/public/common/main_function_params.h" 24 #include "content/public/common/main_function_params.h"
24 #include "net/base/network_change_notifier.h" 25 #include "net/base/network_change_notifier.h"
25 26
26 #if defined(TOOLKIT_USES_GTK) 27 #if defined(TOOLKIT_USES_GTK)
27 #include <gtk/gtk.h> 28 #include <gtk/gtk.h>
28 #endif 29 #endif
29 30
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Initialize the session manager observer so that we'll take actions 152 // Initialize the session manager observer so that we'll take actions
152 // per signals sent from the session manager. 153 // per signals sent from the session manager.
153 session_manager_observer_.reset(new chromeos::SessionManagerObserver); 154 session_manager_observer_.reset(new chromeos::SessionManagerObserver);
154 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> 155 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
155 AddObserver(session_manager_observer_.get()); 156 AddObserver(session_manager_observer_.get());
156 157
157 // Initialize the Chrome OS bluetooth subsystem 158 // Initialize the Chrome OS bluetooth subsystem
158 if (parsed_command_line().HasSwitch(switches::kEnableBluetooth)) { 159 if (parsed_command_line().HasSwitch(switches::kEnableBluetooth)) {
159 chromeos::BluetoothManager::Initialize(); 160 chromeos::BluetoothManager::Initialize();
160 } 161 }
162
163 // Initialize the network change notifier for Chrome OS.
164 chromeos::NetworkChangeNotifierChromeos* network_change_notifier =
165 chromeos::CrosNetworkChangeNotifierFactory::GetInstance();
166 chromeos::NetworkLibrary* network_library =
167 chromeos::CrosLibrary::Get()->GetNetworkLibrary();
168 network_change_notifier->Init(network_library);
stevenjb 2011/11/03 20:47:56 I like this much better, but now we should move ad
satorux1 2011/11/03 21:05:53 Good catch. I forgot about removal of observers. I
169 network_library->AddNetworkManagerObserver(network_change_notifier);
170 chromeos::CrosLibrary::Get()->GetPowerLibrary()
171 ->AddObserver(network_change_notifier);
161 } 172 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/net/cros_network_change_notifier_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698