| OLD | NEW |
| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 #include "chromeos/chromeos_switches.h" | 99 #include "chromeos/chromeos_switches.h" |
| 100 #include "chromeos/cryptohome/async_method_caller.h" | 100 #include "chromeos/cryptohome/async_method_caller.h" |
| 101 #include "chromeos/cryptohome/cryptohome_library.h" | 101 #include "chromeos/cryptohome/cryptohome_library.h" |
| 102 #include "chromeos/dbus/dbus_thread_manager.h" | 102 #include "chromeos/dbus/dbus_thread_manager.h" |
| 103 #include "chromeos/dbus/power_manager_client.h" | 103 #include "chromeos/dbus/power_manager_client.h" |
| 104 #include "chromeos/dbus/session_manager_client.h" | 104 #include "chromeos/dbus/session_manager_client.h" |
| 105 #include "chromeos/disks/disk_mount_manager.h" | 105 #include "chromeos/disks/disk_mount_manager.h" |
| 106 #include "chromeos/ime/input_method_manager.h" | 106 #include "chromeos/ime/input_method_manager.h" |
| 107 #include "chromeos/ime/xkeyboard.h" | 107 #include "chromeos/ime/xkeyboard.h" |
| 108 #include "chromeos/login/login_state.h" | 108 #include "chromeos/login/login_state.h" |
| 109 #include "chromeos/network/cert_loader.h" | |
| 110 #include "chromeos/network/geolocation_handler.h" | |
| 111 #include "chromeos/network/managed_network_configuration_handler.h" | |
| 112 #include "chromeos/network/network_change_notifier_chromeos.h" | 109 #include "chromeos/network/network_change_notifier_chromeos.h" |
| 113 #include "chromeos/network/network_change_notifier_factory_chromeos.h" | 110 #include "chromeos/network/network_change_notifier_factory_chromeos.h" |
| 114 #include "chromeos/network/network_configuration_handler.h" | 111 #include "chromeos/network/network_handler.h" |
| 115 #include "chromeos/network/network_connection_handler.h" | |
| 116 #include "chromeos/network/network_event_log.h" | |
| 117 #include "chromeos/network/network_profile_handler.h" | |
| 118 #include "chromeos/network/network_state_handler.h" | |
| 119 #include "chromeos/power/power_manager_handler.h" | 112 #include "chromeos/power/power_manager_handler.h" |
| 120 #include "content/public/browser/browser_thread.h" | 113 #include "content/public/browser/browser_thread.h" |
| 121 #include "content/public/browser/notification_service.h" | 114 #include "content/public/browser/notification_service.h" |
| 122 #include "content/public/browser/power_save_blocker.h" | 115 #include "content/public/browser/power_save_blocker.h" |
| 123 #include "content/public/common/main_function_params.h" | 116 #include "content/public/common/main_function_params.h" |
| 124 #include "grit/platform_locale_settings.h" | 117 #include "grit/platform_locale_settings.h" |
| 125 #include "net/base/network_change_notifier.h" | 118 #include "net/base/network_change_notifier.h" |
| 126 #include "net/url_request/url_request.h" | 119 #include "net/url_request/url_request.h" |
| 127 #include "net/url_request/url_request_context_getter.h" | 120 #include "net/url_request/url_request_context_getter.h" |
| 128 | 121 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 user_data_dir.AppendASCII("stub_user_policy")); | 300 user_data_dir.AppendASCII("stub_user_policy")); |
| 308 } | 301 } |
| 309 } | 302 } |
| 310 | 303 |
| 311 // Initialize DBusThreadManager for the browser. This must be done after | 304 // Initialize DBusThreadManager for the browser. This must be done after |
| 312 // the main message loop is started, as it uses the message loop. | 305 // the main message loop is started, as it uses the message loop. |
| 313 DBusThreadManager::Initialize(); | 306 DBusThreadManager::Initialize(); |
| 314 CrosDBusService::Initialize(); | 307 CrosDBusService::Initialize(); |
| 315 | 308 |
| 316 LoginState::Initialize(); | 309 LoginState::Initialize(); |
| 317 CertLoader::Initialize(); | |
| 318 CertLibrary::Initialize(); | |
| 319 CryptohomeLibrary::Initialize(); | 310 CryptohomeLibrary::Initialize(); |
| 320 | 311 |
| 321 // This function and SystemKeyEventListener use InputMethodManager. | 312 // This function and SystemKeyEventListener use InputMethodManager. |
| 322 chromeos::input_method::Initialize( | 313 chromeos::input_method::Initialize( |
| 323 content::BrowserThread::GetMessageLoopProxyForThread( | 314 content::BrowserThread::GetMessageLoopProxyForThread( |
| 324 content::BrowserThread::UI), | 315 content::BrowserThread::UI), |
| 325 content::BrowserThread::GetMessageLoopProxyForThread( | 316 content::BrowserThread::GetMessageLoopProxyForThread( |
| 326 content::BrowserThread::FILE)); | 317 content::BrowserThread::FILE)); |
| 327 disks::DiskMountManager::Initialize(); | 318 disks::DiskMountManager::Initialize(); |
| 328 cryptohome::AsyncMethodCaller::Initialize(); | 319 cryptohome::AsyncMethodCaller::Initialize(); |
| 329 | 320 |
| 330 // Always initialize these handlers which should not conflict with | 321 // Always initialize these handlers which should not conflict with |
| 331 // NetworkLibrary. | 322 // NetworkLibrary. |
| 332 network_event_log::Initialize(); | 323 NetworkHandler::Initialize(); |
| 333 GeolocationHandler::Initialize(); | 324 CertLibrary::Initialize(); |
| 334 NetworkStateHandler::Initialize(); | |
| 335 | |
| 336 NetworkProfileHandler* profile_handler = | |
| 337 NetworkProfileHandler::Initialize(); | |
| 338 NetworkConfigurationHandler::Initialize(); | |
| 339 ManagedNetworkConfigurationHandler::Initialize(profile_handler); | |
| 340 NetworkConnectionHandler::Initialize(); | |
| 341 | 325 |
| 342 // Initialize the network change notifier for Chrome OS. The network | 326 // Initialize the network change notifier for Chrome OS. The network |
| 343 // change notifier starts to monitor changes from the power manager and | 327 // change notifier starts to monitor changes from the power manager and |
| 344 // the network manager. | 328 // the network manager. |
| 345 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 329 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 346 chromeos::switches::kDisableNewNetworkChangeNotifier)) { | 330 chromeos::switches::kDisableNewNetworkChangeNotifier)) { |
| 347 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize(); | 331 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize(); |
| 348 } else { | 332 } else { |
| 349 CrosNetworkChangeNotifierFactory::GetInstance()->Init(); | 333 CrosNetworkChangeNotifierFactory::GetInstance()->Init(); |
| 350 } | 334 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 372 ~DBusServices() { | 356 ~DBusServices() { |
| 373 ConnectivityStateHelper::Shutdown(); | 357 ConnectivityStateHelper::Shutdown(); |
| 374 // CrosLibrary is shut down before DBusThreadManager even though it | 358 // CrosLibrary is shut down before DBusThreadManager even though it |
| 375 // is initialized first becuase some of its libraries depend on DBus | 359 // is initialized first becuase some of its libraries depend on DBus |
| 376 // clients. | 360 // clients. |
| 377 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. | 361 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. |
| 378 // (crosbug.com/26160) | 362 // (crosbug.com/26160) |
| 379 if (cros_initialized_ && CrosLibrary::Get()) | 363 if (cros_initialized_ && CrosLibrary::Get()) |
| 380 CrosLibrary::Shutdown(); | 364 CrosLibrary::Shutdown(); |
| 381 | 365 |
| 382 NetworkConnectionHandler::Shutdown(); | 366 CertLibrary::Shutdown(); |
| 383 ManagedNetworkConfigurationHandler::Shutdown(); | 367 NetworkHandler::Shutdown(); |
| 384 NetworkConfigurationHandler::Shutdown(); | |
| 385 NetworkProfileHandler::Shutdown(); | |
| 386 | |
| 387 NetworkStateHandler::Shutdown(); | |
| 388 GeolocationHandler::Shutdown(); | |
| 389 network_event_log::Shutdown(); | |
| 390 | 368 |
| 391 cryptohome::AsyncMethodCaller::Shutdown(); | 369 cryptohome::AsyncMethodCaller::Shutdown(); |
| 392 disks::DiskMountManager::Shutdown(); | 370 disks::DiskMountManager::Shutdown(); |
| 393 input_method::Shutdown(); | 371 input_method::Shutdown(); |
| 372 |
| 394 CryptohomeLibrary::Shutdown(); | 373 CryptohomeLibrary::Shutdown(); |
| 395 CertLibrary::Shutdown(); | |
| 396 CertLoader::Shutdown(); | |
| 397 LoginState::Shutdown(); | 374 LoginState::Shutdown(); |
| 398 | 375 |
| 399 CrosDBusService::Shutdown(); | 376 CrosDBusService::Shutdown(); |
| 400 | 377 |
| 401 // NOTE: This must only be called if Initialize() was called. | 378 // NOTE: This must only be called if Initialize() was called. |
| 402 DBusThreadManager::Shutdown(); | 379 DBusThreadManager::Shutdown(); |
| 403 } | 380 } |
| 404 | 381 |
| 405 private: | 382 private: |
| 406 bool cros_initialized_; | 383 bool cros_initialized_; |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); | 886 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); |
| 910 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); | 887 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); |
| 911 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); | 888 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); |
| 912 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); | 889 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); |
| 913 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); | 890 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); |
| 914 // This is necessary to start the experiment as a side effect. | 891 // This is necessary to start the experiment as a side effect. |
| 915 trial->group(); | 892 trial->group(); |
| 916 } | 893 } |
| 917 | 894 |
| 918 } // namespace chromeos | 895 } // namespace chromeos |
| OLD | NEW |