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

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

Issue 673713003: Create a NetworkConnect class and Delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More virtual fixes Created 6 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/chromeos/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #include "chrome/browser/chromeos/settings/device_settings_service.h" 71 #include "chrome/browser/chromeos/settings/device_settings_service.h"
72 #include "chrome/browser/chromeos/status/data_promo_notification.h" 72 #include "chrome/browser/chromeos/status/data_promo_notification.h"
73 #include "chrome/browser/chromeos/system/input_device_settings.h" 73 #include "chrome/browser/chromeos/system/input_device_settings.h"
74 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" 74 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h"
75 #include "chrome/browser/defaults.h" 75 #include "chrome/browser/defaults.h"
76 #include "chrome/browser/lifetime/application_lifetime.h" 76 #include "chrome/browser/lifetime/application_lifetime.h"
77 #include "chrome/browser/net/chrome_network_delegate.h" 77 #include "chrome/browser/net/chrome_network_delegate.h"
78 #include "chrome/browser/profiles/profile.h" 78 #include "chrome/browser/profiles/profile.h"
79 #include "chrome/browser/profiles/profile_manager.h" 79 #include "chrome/browser/profiles/profile_manager.h"
80 #include "chrome/browser/rlz/rlz.h" 80 #include "chrome/browser/rlz/rlz.h"
81 #include "chrome/browser/ui/ash/network_connect_delegate_chromeos.h"
81 #include "chrome/common/chrome_constants.h" 82 #include "chrome/common/chrome_constants.h"
82 #include "chrome/common/chrome_paths.h" 83 #include "chrome/common/chrome_paths.h"
83 #include "chrome/common/chrome_switches.h" 84 #include "chrome/common/chrome_switches.h"
84 #include "chrome/common/chrome_version_info.h" 85 #include "chrome/common/chrome_version_info.h"
85 #include "chrome/common/logging_chrome.h" 86 #include "chrome/common/logging_chrome.h"
86 #include "chrome/common/pref_names.h" 87 #include "chrome/common/pref_names.h"
87 #include "chromeos/audio/audio_devices_pref_handler.h" 88 #include "chromeos/audio/audio_devices_pref_handler.h"
88 #include "chromeos/audio/cras_audio_handler.h" 89 #include "chromeos/audio/cras_audio_handler.h"
89 #include "chromeos/cert_loader.h" 90 #include "chromeos/cert_loader.h"
90 #include "chromeos/chromeos_paths.h" 91 #include "chromeos/chromeos_paths.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 cryptohome::HomedirMethods::Initialize(); 173 cryptohome::HomedirMethods::Initialize();
173 174
174 NetworkHandler::Initialize(); 175 NetworkHandler::Initialize();
175 CertLibrary::Initialize(); 176 CertLibrary::Initialize();
176 177
177 // Initialize the network change notifier for Chrome OS. The network 178 // Initialize the network change notifier for Chrome OS. The network
178 // change notifier starts to monitor changes from the power manager and 179 // change notifier starts to monitor changes from the power manager and
179 // the network manager. 180 // the network manager.
180 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize(); 181 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize();
181 182
183 // Initialize the NetworkConnect handler.
184 network_connect_delegate_.reset(new NetworkConnectDelegateChromeOS);
185 ash::NetworkConnect::Initialize(network_connect_delegate_.get());
186
182 // Likewise, initialize the upgrade detector for Chrome OS. The upgrade 187 // Likewise, initialize the upgrade detector for Chrome OS. The upgrade
183 // detector starts to monitor changes from the update engine. 188 // detector starts to monitor changes from the update engine.
184 UpgradeDetectorChromeos::GetInstance()->Init(); 189 UpgradeDetectorChromeos::GetInstance()->Init();
185 190
186 // Initialize the device settings service so that we'll take actions per 191 // Initialize the device settings service so that we'll take actions per
187 // signals sent from the session manager. This needs to happen before 192 // signals sent from the session manager. This needs to happen before
188 // g_browser_process initializes BrowserPolicyConnector. 193 // g_browser_process initializes BrowserPolicyConnector.
189 DeviceSettingsService::Initialize(); 194 DeviceSettingsService::Initialize();
190 DeviceSettingsService::Get()->SetSessionManager( 195 DeviceSettingsService::Get()->SetSessionManager(
191 DBusThreadManager::Get()->GetSessionManagerClient(), 196 DBusThreadManager::Get()->GetSessionManagerClient(),
192 OwnerSettingsServiceChromeOSFactory::GetInstance()->GetOwnerKeyUtil()); 197 OwnerSettingsServiceChromeOSFactory::GetInstance()->GetOwnerKeyUtil());
193 } 198 }
194 199
195 ~DBusServices() { 200 ~DBusServices() {
201 ash::NetworkConnect::Shutdown();
202 network_connect_delegate_.reset();
203
196 CertLibrary::Shutdown(); 204 CertLibrary::Shutdown();
197 NetworkHandler::Shutdown(); 205 NetworkHandler::Shutdown();
198 206
199 cryptohome::AsyncMethodCaller::Shutdown(); 207 cryptohome::AsyncMethodCaller::Shutdown();
200 disks::DiskMountManager::Shutdown(); 208 disks::DiskMountManager::Shutdown();
201 209
202 SystemSaltGetter::Shutdown(); 210 SystemSaltGetter::Shutdown();
203 LoginState::Shutdown(); 211 LoginState::Shutdown();
204 CertLoader::Shutdown(); 212 CertLoader::Shutdown();
205 TPMTokenLoader::Shutdown(); 213 TPMTokenLoader::Shutdown();
206 214
207 CrosDBusService::Shutdown(); 215 CrosDBusService::Shutdown();
208 216
209 // Shutdown the PowerDataCollector before shutting down DBusThreadManager. 217 // Shutdown the PowerDataCollector before shutting down DBusThreadManager.
210 PowerDataCollector::Shutdown(); 218 PowerDataCollector::Shutdown();
211 219
212 // NOTE: This must only be called if Initialize() was called. 220 // NOTE: This must only be called if Initialize() was called.
213 DBusThreadManager::Shutdown(); 221 DBusThreadManager::Shutdown();
214 } 222 }
215 223
216 private: 224 private:
225 scoped_ptr<NetworkConnectDelegateChromeOS> network_connect_delegate_;
217 226
218 DISALLOW_COPY_AND_ASSIGN(DBusServices); 227 DISALLOW_COPY_AND_ASSIGN(DBusServices);
219 }; 228 };
220 229
221 } // namespace internal 230 } // namespace internal
222 231
223 // ChromeBrowserMainPartsChromeos ---------------------------------------------- 232 // ChromeBrowserMainPartsChromeos ----------------------------------------------
224 233
225 ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos( 234 ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos(
226 const content::MainFunctionParams& parameters) 235 const content::MainFunctionParams& parameters)
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 // Destroy DBus services immediately after threads are stopped. 775 // Destroy DBus services immediately after threads are stopped.
767 dbus_services_.reset(); 776 dbus_services_.reset();
768 777
769 ChromeBrowserMainPartsLinux::PostDestroyThreads(); 778 ChromeBrowserMainPartsLinux::PostDestroyThreads();
770 779
771 // Destroy DeviceSettingsService after g_browser_process. 780 // Destroy DeviceSettingsService after g_browser_process.
772 DeviceSettingsService::Shutdown(); 781 DeviceSettingsService::Shutdown();
773 } 782 }
774 783
775 } // namespace chromeos 784 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/test/test_system_tray_delegate.h ('k') | chrome/browser/chromeos/mobile/mobile_activator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698