| 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_helper.h" |
| 29 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" |
| 29 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" | 30 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" |
| 30 #include "chrome/browser/chromeos/login/authenticator.h" | 31 #include "chrome/browser/chromeos/login/authenticator.h" |
| 31 #include "chrome/browser/chromeos/login/login_utils.h" | 32 #include "chrome/browser/chromeos/login/login_utils.h" |
| 32 #include "chrome/browser/chromeos/login/ownership_service.h" | 33 #include "chrome/browser/chromeos/login/ownership_service.h" |
| 33 #include "chrome/browser/chromeos/login/screen_locker.h" | 34 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 34 #include "chrome/browser/chromeos/login/session_manager_observer.h" | 35 #include "chrome/browser/chromeos/login/session_manager_observer.h" |
| 35 #include "chrome/browser/chromeos/login/user_manager.h" | 36 #include "chrome/browser/chromeos/login/user_manager.h" |
| 36 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" | 37 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" |
| 37 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" | 38 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" |
| 38 #include "chrome/browser/chromeos/power/brightness_observer.h" | 39 #include "chrome/browser/chromeos/power/brightness_observer.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 #endif | 357 #endif |
| 357 | 358 |
| 358 // Trigger prefetching of ownership status. | 359 // Trigger prefetching of ownership status. |
| 359 chromeos::OwnershipService::GetSharedInstance()->Prewarm(); | 360 chromeos::OwnershipService::GetSharedInstance()->Prewarm(); |
| 360 | 361 |
| 361 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 362 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 362 // -- just before CreateProfile(). | 363 // -- just before CreateProfile(). |
| 363 | 364 |
| 364 // Initialize the screen locker now so that it can receive | 365 // Initialize the screen locker now so that it can receive |
| 365 // LOGIN_USER_CHANGED notification from UserManager. | 366 // LOGIN_USER_CHANGED notification from UserManager. |
| 366 chromeos::ScreenLocker::InitClass(); | 367 if (chromeos::KioskModeHelper::IsKioskModeEnabled()) { |
| 368 chromeos::InitializeKioskModeIdleLogout(); |
| 369 } else { |
| 370 chromeos::ScreenLocker::InitClass(); |
| 371 } |
| 367 | 372 |
| 368 // This forces the ProfileManager to be created and register for the | 373 // This forces the ProfileManager to be created and register for the |
| 369 // notification it needs to track the logged in user. | 374 // notification it needs to track the logged in user. |
| 370 g_browser_process->profile_manager(); | 375 g_browser_process->profile_manager(); |
| 371 | 376 |
| 372 // TODO(abarth): Should this move to InitializeNetworkOptions()? | 377 // TODO(abarth): Should this move to InitializeNetworkOptions()? |
| 373 // Allow access to file:// on ChromeOS for tests. | 378 // Allow access to file:// on ChromeOS for tests. |
| 374 if (parsed_command_line().HasSwitch(switches::kAllowFileAccess)) | 379 if (parsed_command_line().HasSwitch(switches::kAllowFileAccess)) |
| 375 net::URLRequest::AllowFileAccess(); | 380 net::URLRequest::AllowFileAccess(); |
| 376 | 381 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell | 548 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell |
| 544 // singleton before the shell is destroyed. | 549 // singleton before the shell is destroyed. |
| 545 video_property_writer_.reset(); | 550 video_property_writer_.reset(); |
| 546 // Remove PowerButtonObserver attached to a D-Bus client before | 551 // Remove PowerButtonObserver attached to a D-Bus client before |
| 547 // DBusThreadManager is shut down. | 552 // DBusThreadManager is shut down. |
| 548 power_button_observer_.reset(); | 553 power_button_observer_.reset(); |
| 549 #endif | 554 #endif |
| 550 | 555 |
| 551 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 556 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
| 552 } | 557 } |
| OLD | NEW |