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/cros/cros_library.h" | 19 #include "chrome/browser/chromeos/cros/cros_library.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/retail_mode/retail_mode_screen_locker.h" |
28 #include "chrome/browser/chromeos/login/authenticator.h" | 29 #include "chrome/browser/chromeos/login/authenticator.h" |
29 #include "chrome/browser/chromeos/login/login_utils.h" | 30 #include "chrome/browser/chromeos/login/login_utils.h" |
30 #include "chrome/browser/chromeos/login/ownership_service.h" | 31 #include "chrome/browser/chromeos/login/ownership_service.h" |
31 #include "chrome/browser/chromeos/login/screen_locker.h" | 32 #include "chrome/browser/chromeos/login/screen_locker.h" |
32 #include "chrome/browser/chromeos/login/session_manager_observer.h" | 33 #include "chrome/browser/chromeos/login/session_manager_observer.h" |
33 #include "chrome/browser/chromeos/login/user_manager.h" | 34 #include "chrome/browser/chromeos/login/user_manager.h" |
34 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" | 35 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" |
35 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" | 36 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" |
36 #include "chrome/browser/chromeos/power/brightness_observer.h" | 37 #include "chrome/browser/chromeos/power/brightness_observer.h" |
37 #include "chrome/browser/chromeos/power/resume_observer.h" | 38 #include "chrome/browser/chromeos/power/resume_observer.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 #endif | 351 #endif |
351 | 352 |
352 // Trigger prefetching of ownership status. | 353 // Trigger prefetching of ownership status. |
353 chromeos::OwnershipService::GetSharedInstance()->Prewarm(); | 354 chromeos::OwnershipService::GetSharedInstance()->Prewarm(); |
354 | 355 |
355 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 356 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
356 // -- just before CreateProfile(). | 357 // -- just before CreateProfile(). |
357 | 358 |
358 // Initialize the screen locker now so that it can receive | 359 // Initialize the screen locker now so that it can receive |
359 // LOGIN_USER_CHANGED notification from UserManager. | 360 // LOGIN_USER_CHANGED notification from UserManager. |
360 chromeos::ScreenLocker::InitClass(); | 361 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 362 switches::kEnableRetailMode)) { |
| 363 chromeos::RetailModeScreenLocker::InitClass(); |
| 364 } else { |
| 365 chromeos::ScreenLocker::InitClass(); |
| 366 } |
361 | 367 |
362 // This forces the ProfileManager to be created and register for the | 368 // This forces the ProfileManager to be created and register for the |
363 // notification it needs to track the logged in user. | 369 // notification it needs to track the logged in user. |
364 g_browser_process->profile_manager(); | 370 g_browser_process->profile_manager(); |
365 | 371 |
366 // TODO(abarth): Should this move to InitializeNetworkOptions()? | 372 // TODO(abarth): Should this move to InitializeNetworkOptions()? |
367 // Allow access to file:// on ChromeOS for tests. | 373 // Allow access to file:// on ChromeOS for tests. |
368 if (parsed_command_line().HasSwitch(switches::kAllowFileAccess)) | 374 if (parsed_command_line().HasSwitch(switches::kAllowFileAccess)) |
369 net::URLRequest::AllowFileAccess(); | 375 net::URLRequest::AllowFileAccess(); |
370 | 376 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell | 529 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell |
524 // singleton before the shell is destroyed. | 530 // singleton before the shell is destroyed. |
525 video_property_writer_.reset(); | 531 video_property_writer_.reset(); |
526 // Remove PowerButtonObserver attached to a D-Bus client before | 532 // Remove PowerButtonObserver attached to a D-Bus client before |
527 // DBusThreadManager is shut down. | 533 // DBusThreadManager is shut down. |
528 power_button_observer_.reset(); | 534 power_button_observer_.reset(); |
529 #endif | 535 #endif |
530 | 536 |
531 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 537 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
532 } | 538 } |
OLD | NEW |