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