| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 #include "chrome/browser/storage_monitor/storage_monitor_chromeos.h" | 88 #include "chrome/browser/storage_monitor/storage_monitor_chromeos.h" |
| 89 #include "chrome/common/chrome_notification_types.h" | 89 #include "chrome/common/chrome_notification_types.h" |
| 90 #include "chrome/common/chrome_paths.h" | 90 #include "chrome/common/chrome_paths.h" |
| 91 #include "chrome/common/chrome_switches.h" | 91 #include "chrome/common/chrome_switches.h" |
| 92 #include "chrome/common/chrome_version_info.h" | 92 #include "chrome/common/chrome_version_info.h" |
| 93 #include "chrome/common/logging_chrome.h" | 93 #include "chrome/common/logging_chrome.h" |
| 94 #include "chrome/common/pref_names.h" | 94 #include "chrome/common/pref_names.h" |
| 95 #include "chromeos/audio/audio_devices_pref_handler.h" | 95 #include "chromeos/audio/audio_devices_pref_handler.h" |
| 96 #include "chromeos/audio/audio_pref_handler.h" | 96 #include "chromeos/audio/audio_pref_handler.h" |
| 97 #include "chromeos/audio/cras_audio_handler.h" | 97 #include "chromeos/audio/cras_audio_handler.h" |
| 98 #include "chromeos/chromeos_paths.h" |
| 98 #include "chromeos/chromeos_switches.h" | 99 #include "chromeos/chromeos_switches.h" |
| 99 #include "chromeos/cryptohome/async_method_caller.h" | 100 #include "chromeos/cryptohome/async_method_caller.h" |
| 100 #include "chromeos/cryptohome/cryptohome_library.h" | 101 #include "chromeos/cryptohome/cryptohome_library.h" |
| 101 #include "chromeos/dbus/dbus_thread_manager.h" | 102 #include "chromeos/dbus/dbus_thread_manager.h" |
| 102 #include "chromeos/dbus/power_manager_client.h" | 103 #include "chromeos/dbus/power_manager_client.h" |
| 103 #include "chromeos/dbus/session_manager_client.h" | 104 #include "chromeos/dbus/session_manager_client.h" |
| 104 #include "chromeos/disks/disk_mount_manager.h" | 105 #include "chromeos/disks/disk_mount_manager.h" |
| 105 #include "chromeos/ime/input_method_manager.h" | 106 #include "chromeos/ime/input_method_manager.h" |
| 106 #include "chromeos/ime/xkeyboard.h" | 107 #include "chromeos/ime/xkeyboard.h" |
| 107 #include "chromeos/login/login_state.h" | 108 #include "chromeos/login/login_state.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 explicit DBusServices(const content::MainFunctionParams& parameters) | 294 explicit DBusServices(const content::MainFunctionParams& parameters) |
| 294 : cros_initialized_(false) { | 295 : cros_initialized_(false) { |
| 295 // Initialize CrosLibrary only for the browser, unless running tests | 296 // Initialize CrosLibrary only for the browser, unless running tests |
| 296 // (which do their own CrosLibrary setup). | 297 // (which do their own CrosLibrary setup). |
| 297 if (!parameters.ui_task) { | 298 if (!parameters.ui_task) { |
| 298 const bool use_stub = !base::chromeos::IsRunningOnChromeOS(); | 299 const bool use_stub = !base::chromeos::IsRunningOnChromeOS(); |
| 299 CrosLibrary::Initialize(use_stub); | 300 CrosLibrary::Initialize(use_stub); |
| 300 cros_initialized_ = true; | 301 cros_initialized_ = true; |
| 301 } | 302 } |
| 302 | 303 |
| 304 if (!base::chromeos::IsRunningOnChromeOS()) { |
| 305 // Override this path on the desktop, so that the user policy key can be |
| 306 // stored by the stub SessionManagerClient. |
| 307 base::FilePath user_data_dir; |
| 308 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { |
| 309 PathService::Override(chromeos::DIR_USER_POLICY_KEYS, |
| 310 user_data_dir.AppendASCII("stub_user_policy")); |
| 311 } |
| 312 } |
| 313 |
| 303 // Initialize DBusThreadManager for the browser. This must be done after | 314 // Initialize DBusThreadManager for the browser. This must be done after |
| 304 // the main message loop is started, as it uses the message loop. | 315 // the main message loop is started, as it uses the message loop. |
| 305 DBusThreadManager::Initialize(); | 316 DBusThreadManager::Initialize(); |
| 306 CrosDBusService::Initialize(); | 317 CrosDBusService::Initialize(); |
| 307 | 318 |
| 308 LoginState::Initialize(); | 319 LoginState::Initialize(); |
| 309 CertLoader::Initialize(); | 320 CertLoader::Initialize(); |
| 310 CertLibrary::Initialize(); | 321 CertLibrary::Initialize(); |
| 311 CryptohomeLibrary::Initialize(); | 322 CryptohomeLibrary::Initialize(); |
| 312 | 323 |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); | 906 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); |
| 896 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); | 907 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); |
| 897 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); | 908 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); |
| 898 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); | 909 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); |
| 899 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); | 910 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); |
| 900 // This is necessary to start the experiment as a side effect. | 911 // This is necessary to start the experiment as a side effect. |
| 901 trial->group(); | 912 trial->group(); |
| 902 } | 913 } |
| 903 | 914 |
| 904 } // namespace chromeos | 915 } // namespace chromeos |
| OLD | NEW |