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

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

Issue 14729017: Add NetworkHandler to own network handlers in src/chromeos/network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 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
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 #include "chromeos/chromeos_switches.h" 98 #include "chromeos/chromeos_switches.h"
99 #include "chromeos/cryptohome/async_method_caller.h" 99 #include "chromeos/cryptohome/async_method_caller.h"
100 #include "chromeos/cryptohome/cryptohome_library.h" 100 #include "chromeos/cryptohome/cryptohome_library.h"
101 #include "chromeos/dbus/dbus_thread_manager.h" 101 #include "chromeos/dbus/dbus_thread_manager.h"
102 #include "chromeos/dbus/power_manager_client.h" 102 #include "chromeos/dbus/power_manager_client.h"
103 #include "chromeos/dbus/session_manager_client.h" 103 #include "chromeos/dbus/session_manager_client.h"
104 #include "chromeos/disks/disk_mount_manager.h" 104 #include "chromeos/disks/disk_mount_manager.h"
105 #include "chromeos/ime/input_method_manager.h" 105 #include "chromeos/ime/input_method_manager.h"
106 #include "chromeos/ime/xkeyboard.h" 106 #include "chromeos/ime/xkeyboard.h"
107 #include "chromeos/login/login_state.h" 107 #include "chromeos/login/login_state.h"
108 #include "chromeos/network/cert_loader.h"
109 #include "chromeos/network/geolocation_handler.h"
110 #include "chromeos/network/managed_network_configuration_handler.h"
111 #include "chromeos/network/network_change_notifier_chromeos.h" 108 #include "chromeos/network/network_change_notifier_chromeos.h"
112 #include "chromeos/network/network_change_notifier_factory_chromeos.h" 109 #include "chromeos/network/network_change_notifier_factory_chromeos.h"
113 #include "chromeos/network/network_configuration_handler.h" 110 #include "chromeos/network/network_handler.h"
114 #include "chromeos/network/network_event_log.h"
115 #include "chromeos/network/network_profile_handler.h"
116 #include "chromeos/network/network_state_handler.h"
117 #include "content/public/browser/browser_thread.h" 111 #include "content/public/browser/browser_thread.h"
118 #include "content/public/browser/notification_service.h" 112 #include "content/public/browser/notification_service.h"
119 #include "content/public/browser/power_save_blocker.h" 113 #include "content/public/browser/power_save_blocker.h"
120 #include "content/public/common/main_function_params.h" 114 #include "content/public/common/main_function_params.h"
121 #include "grit/platform_locale_settings.h" 115 #include "grit/platform_locale_settings.h"
122 #include "net/base/network_change_notifier.h" 116 #include "net/base/network_change_notifier.h"
123 #include "net/url_request/url_request.h" 117 #include "net/url_request/url_request.h"
124 #include "net/url_request/url_request_context_getter.h" 118 #include "net/url_request/url_request_context_getter.h"
125 119
126 namespace chromeos { 120 namespace chromeos {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 CrosLibrary::Initialize(use_stub); 293 CrosLibrary::Initialize(use_stub);
300 cros_initialized_ = true; 294 cros_initialized_ = true;
301 } 295 }
302 296
303 // Initialize DBusThreadManager for the browser. This must be done after 297 // Initialize DBusThreadManager for the browser. This must be done after
304 // the main message loop is started, as it uses the message loop. 298 // the main message loop is started, as it uses the message loop.
305 DBusThreadManager::Initialize(); 299 DBusThreadManager::Initialize();
306 CrosDBusService::Initialize(); 300 CrosDBusService::Initialize();
307 301
308 LoginState::Initialize(); 302 LoginState::Initialize();
309 CertLoader::Initialize();
310 CertLibrary::Initialize();
311 CryptohomeLibrary::Initialize(); 303 CryptohomeLibrary::Initialize();
312 304
313 // This function and SystemKeyEventListener use InputMethodManager. 305 // This function and SystemKeyEventListener use InputMethodManager.
314 chromeos::input_method::Initialize( 306 chromeos::input_method::Initialize(
315 content::BrowserThread::GetMessageLoopProxyForThread( 307 content::BrowserThread::GetMessageLoopProxyForThread(
316 content::BrowserThread::UI), 308 content::BrowserThread::UI),
317 content::BrowserThread::GetMessageLoopProxyForThread( 309 content::BrowserThread::GetMessageLoopProxyForThread(
318 content::BrowserThread::FILE)); 310 content::BrowserThread::FILE));
319 disks::DiskMountManager::Initialize(); 311 disks::DiskMountManager::Initialize();
320 cryptohome::AsyncMethodCaller::Initialize(); 312 cryptohome::AsyncMethodCaller::Initialize();
321 313
322 // Always initialize these handlers which should not conflict with 314 // Always initialize these handlers which should not conflict with
323 // NetworkLibrary. 315 // NetworkLibrary.
324 network_event_log::Initialize(); 316 NetworkHandler::Initialize();
325 GeolocationHandler::Initialize(); 317 CertLibrary::Initialize();
326 NetworkStateHandler::Initialize();
327
328 NetworkProfileHandler* profile_handler =
329 NetworkProfileHandler::Initialize();
330 NetworkConfigurationHandler::Initialize();
331 ManagedNetworkConfigurationHandler::Initialize(profile_handler);
332 318
333 // Initialize the network change notifier for Chrome OS. The network 319 // Initialize the network change notifier for Chrome OS. The network
334 // change notifier starts to monitor changes from the power manager and 320 // change notifier starts to monitor changes from the power manager and
335 // the network manager. 321 // the network manager.
336 if (!CommandLine::ForCurrentProcess()->HasSwitch( 322 if (!CommandLine::ForCurrentProcess()->HasSwitch(
337 chromeos::switches::kDisableNewNetworkChangeNotifier)) { 323 chromeos::switches::kDisableNewNetworkChangeNotifier)) {
338 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize(); 324 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize();
339 } else { 325 } else {
340 CrosNetworkChangeNotifierFactory::GetInstance()->Init(); 326 CrosNetworkChangeNotifierFactory::GetInstance()->Init();
341 } 327 }
(...skipping 21 matching lines...) Expand all
363 ~DBusServices() { 349 ~DBusServices() {
364 ConnectivityStateHelper::Shutdown(); 350 ConnectivityStateHelper::Shutdown();
365 // CrosLibrary is shut down before DBusThreadManager even though it 351 // CrosLibrary is shut down before DBusThreadManager even though it
366 // is initialized first becuase some of its libraries depend on DBus 352 // is initialized first becuase some of its libraries depend on DBus
367 // clients. 353 // clients.
368 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. 354 // TODO(hashimoto): Resolve this situation by removing CrosLibrary.
369 // (crosbug.com/26160) 355 // (crosbug.com/26160)
370 if (cros_initialized_ && CrosLibrary::Get()) 356 if (cros_initialized_ && CrosLibrary::Get())
371 CrosLibrary::Shutdown(); 357 CrosLibrary::Shutdown();
372 358
373 ManagedNetworkConfigurationHandler::Shutdown(); 359 CertLibrary::Shutdown();
374 NetworkConfigurationHandler::Shutdown(); 360 NetworkHandler::Shutdown();
375 NetworkProfileHandler::Shutdown();
376
377 NetworkStateHandler::Shutdown();
378 GeolocationHandler::Shutdown();
379 network_event_log::Shutdown();
380 361
381 cryptohome::AsyncMethodCaller::Shutdown(); 362 cryptohome::AsyncMethodCaller::Shutdown();
382 disks::DiskMountManager::Shutdown(); 363 disks::DiskMountManager::Shutdown();
383 input_method::Shutdown(); 364 input_method::Shutdown();
365
384 CryptohomeLibrary::Shutdown(); 366 CryptohomeLibrary::Shutdown();
385 CertLibrary::Shutdown();
386 CertLoader::Shutdown();
387 LoginState::Shutdown(); 367 LoginState::Shutdown();
388 368
389 CrosDBusService::Shutdown(); 369 CrosDBusService::Shutdown();
390 370
391 // NOTE: This must only be called if Initialize() was called. 371 // NOTE: This must only be called if Initialize() was called.
392 DBusThreadManager::Shutdown(); 372 DBusThreadManager::Shutdown();
393 } 373 }
394 374
395 private: 375 private:
396 bool cros_initialized_; 376 bool cros_initialized_;
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); 875 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0);
896 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); 876 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0);
897 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); 877 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0);
898 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); 878 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0);
899 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); 879 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0);
900 // This is necessary to start the experiment as a side effect. 880 // This is necessary to start the experiment as a side effect.
901 trial->group(); 881 trial->group();
902 } 882 }
903 883
904 } // namespace chromeos 884 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698