| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "chrome/browser/browser_process_impl.h" | 13 #include "chrome/browser/browser_process_impl.h" |
| 14 #include "chrome/browser/chromeos/audio/audio_handler.h" | 14 #include "chrome/browser/chromeos/audio/audio_handler.h" |
| 15 #include "chrome/browser/chromeos/bluetooth/bluetooth_manager.h" | 15 #include "chrome/browser/chromeos/bluetooth/bluetooth_manager.h" |
| 16 #include "chrome/browser/chromeos/boot_times_loader.h" | 16 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 17 #include "chrome/browser/chromeos/boot_times_loader.h" | 17 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 18 #include "chrome/browser/chromeos/cros/cros_library.h" | 18 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 19 #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" | 19 #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" |
| 20 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 20 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 21 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 21 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
| 22 #include "chrome/browser/chromeos/dbus/session_manager_client.h" | 22 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
| 23 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" | 23 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" |
| 24 #include "chrome/browser/chromeos/external_metrics.h" | 24 #include "chrome/browser/chromeos/external_metrics.h" |
| 25 #include "chrome/browser/chromeos/imageburner/burn_manager.h" | 25 #include "chrome/browser/chromeos/imageburner/burn_manager.h" |
| 26 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 26 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 27 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 27 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| 28 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_helper.h" |
| 28 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" | 29 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" |
| 29 #include "chrome/browser/chromeos/login/authenticator.h" | 30 #include "chrome/browser/chromeos/login/authenticator.h" |
| 30 #include "chrome/browser/chromeos/login/login_utils.h" | 31 #include "chrome/browser/chromeos/login/login_utils.h" |
| 31 #include "chrome/browser/chromeos/login/ownership_service.h" | 32 #include "chrome/browser/chromeos/login/ownership_service.h" |
| 32 #include "chrome/browser/chromeos/login/screen_locker.h" | 33 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 33 #include "chrome/browser/chromeos/login/session_manager_observer.h" | 34 #include "chrome/browser/chromeos/login/session_manager_observer.h" |
| 34 #include "chrome/browser/chromeos/login/user_manager.h" | 35 #include "chrome/browser/chromeos/login/user_manager.h" |
| 35 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" | 36 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" |
| 36 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" | 37 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" |
| 37 #include "chrome/browser/chromeos/power/brightness_observer.h" | 38 #include "chrome/browser/chromeos/power/brightness_observer.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 if (dimensions.size() == 2) { | 195 if (dimensions.size() == 2) { |
| 195 int width, height; | 196 int width, height; |
| 196 if (base::StringToInt(dimensions[0], &width) && | 197 if (base::StringToInt(dimensions[0], &width) && |
| 197 base::StringToInt(dimensions[1], &height)) | 198 base::StringToInt(dimensions[1], &height)) |
| 198 size.SetSize(width, height); | 199 size.SetSize(width, height); |
| 199 } | 200 } |
| 200 } | 201 } |
| 201 | 202 |
| 202 browser::ShowLoginWizard(first_screen, size); | 203 browser::ShowLoginWizard(first_screen, size); |
| 203 | 204 |
| 204 if (parsed_command_line.HasSwitch(switches::kEnableKioskMode)) | 205 if (chromeos::KioskModeHelper::Get()->IsKioskModeEnabled()) |
| 205 chromeos::InitializeKioskModeScreensaver(); | 206 chromeos::InitializeKioskModeScreensaver(); |
| 206 } else if (parsed_command_line.HasSwitch(switches::kLoginUser) && | 207 } else if (parsed_command_line.HasSwitch(switches::kLoginUser) && |
| 207 parsed_command_line.HasSwitch(switches::kLoginPassword)) { | 208 parsed_command_line.HasSwitch(switches::kLoginPassword)) { |
| 208 chromeos::BootTimesLoader::Get()->RecordLoginAttempted(); | 209 chromeos::BootTimesLoader::Get()->RecordLoginAttempted(); |
| 209 new StubLogin( | 210 new StubLogin( |
| 210 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser), | 211 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser), |
| 211 parsed_command_line.GetSwitchValueASCII(switches::kLoginPassword)); | 212 parsed_command_line.GetSwitchValueASCII(switches::kLoginPassword)); |
| 212 } else { | 213 } else { |
| 213 if (!parsed_command_line.HasSwitch(switches::kTestName)) { | 214 if (!parsed_command_line.HasSwitch(switches::kTestName)) { |
| 214 // We did not log in (we crashed or are debugging), so we need to | 215 // We did not log in (we crashed or are debugging), so we need to |
| 215 // restore Sync. | 216 // restore Sync. |
| 216 chromeos::LoginUtils::Get()->RestoreAuthenticationSession(profile); | 217 chromeos::LoginUtils::Get()->RestoreAuthenticationSession(profile); |
| 217 } | 218 } |
| 218 } | 219 } |
| 219 } | 220 } |
| 220 | 221 |
| 221 // ChromeBrowserMainPartsChromeos ---------------------------------------------- | 222 // ChromeBrowserMainPartsChromeos ---------------------------------------------- |
| 222 | 223 |
| 223 ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos( | 224 ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos( |
| 224 const content::MainFunctionParams& parameters) | 225 const content::MainFunctionParams& parameters) |
| 225 : ChromeBrowserMainPartsLinux(parameters) { | 226 : ChromeBrowserMainPartsLinux(parameters) { |
| 226 } | 227 } |
| 227 | 228 |
| 228 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { | 229 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { |
| 229 chromeos::ShutdownKioskModeScreensaver(); | 230 if (chromeos::KioskModeHelper::Get()->IsKioskModeEnabled()) |
| 231 chromeos::ShutdownKioskModeScreensaver(); |
| 230 cryptohome::AsyncMethodCaller::Shutdown(); | 232 cryptohome::AsyncMethodCaller::Shutdown(); |
| 231 chromeos::imageburner::BurnManager::Shutdown(); | 233 chromeos::imageburner::BurnManager::Shutdown(); |
| 232 chromeos::disks::DiskMountManager::Shutdown(); | 234 chromeos::disks::DiskMountManager::Shutdown(); |
| 233 | 235 |
| 234 // CrosLibrary is shut down before DBusThreadManager even though the former | 236 // CrosLibrary is shut down before DBusThreadManager even though the former |
| 235 // is initialized before the latter becuase some of its libraries depend | 237 // is initialized before the latter becuase some of its libraries depend |
| 236 // on DBus clients. | 238 // on DBus clients. |
| 237 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. | 239 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. |
| 238 // (crosbug.com/26160) | 240 // (crosbug.com/26160) |
| 239 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) | 241 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell | 543 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell |
| 542 // singleton before the shell is destroyed. | 544 // singleton before the shell is destroyed. |
| 543 video_property_writer_.reset(); | 545 video_property_writer_.reset(); |
| 544 // Remove PowerButtonObserver attached to a D-Bus client before | 546 // Remove PowerButtonObserver attached to a D-Bus client before |
| 545 // DBusThreadManager is shut down. | 547 // DBusThreadManager is shut down. |
| 546 power_button_observer_.reset(); | 548 power_button_observer_.reset(); |
| 547 #endif | 549 #endif |
| 548 | 550 |
| 549 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 551 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
| 550 } | 552 } |
| OLD | NEW |