| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "chrome/browser/chromeos/events/keyboard_driven_event_rewriter.h" | 46 #include "chrome/browser/chromeos/events/keyboard_driven_event_rewriter.h" |
| 47 #include "chrome/browser/chromeos/extensions/default_app_order.h" | 47 #include "chrome/browser/chromeos/extensions/default_app_order.h" |
| 48 #include "chrome/browser/chromeos/extensions/extension_volume_observer.h" | 48 #include "chrome/browser/chromeos/extensions/extension_volume_observer.h" |
| 49 #include "chrome/browser/chromeos/external_metrics.h" | 49 #include "chrome/browser/chromeos/external_metrics.h" |
| 50 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 50 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
| 51 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 51 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 52 #include "chrome/browser/chromeos/language_preferences.h" | 52 #include "chrome/browser/chromeos/language_preferences.h" |
| 53 #include "chrome/browser/chromeos/login/helper.h" | 53 #include "chrome/browser/chromeos/login/helper.h" |
| 54 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 54 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 55 #include "chrome/browser/chromeos/login/login_wizard.h" | 55 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 56 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" |
| 56 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 57 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 57 #include "chrome/browser/chromeos/login/startup_utils.h" | 58 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 58 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 59 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 59 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 60 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 60 #include "chrome/browser/chromeos/login/wizard_controller.h" | 61 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 61 #include "chrome/browser/chromeos/net/network_connect_delegate_chromeos.h" | 62 #include "chrome/browser/chromeos/net/network_connect_delegate_chromeos.h" |
| 62 #include "chrome/browser/chromeos/net/network_portal_detector_impl.h" | 63 #include "chrome/browser/chromeos/net/network_portal_detector_impl.h" |
| 63 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" | 64 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" |
| 64 #include "chrome/browser/chromeos/options/cert_library.h" | 65 #include "chrome/browser/chromeos/options/cert_library.h" |
| 65 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" | 66 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 BootTimesRecorder::Get()->RecordChromeMainStats(); | 430 BootTimesRecorder::Get()->RecordChromeMainStats(); |
| 430 LoginEventRecorder::Get()->SetDelegate(BootTimesRecorder::Get()); | 431 LoginEventRecorder::Get()->SetDelegate(BootTimesRecorder::Get()); |
| 431 | 432 |
| 432 // Trigger prefetching of ownership status. | 433 // Trigger prefetching of ownership status. |
| 433 DeviceSettingsService::Get()->Load(); | 434 DeviceSettingsService::Get()->Load(); |
| 434 | 435 |
| 435 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 436 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 436 // -- just before CreateProfile(). | 437 // -- just before CreateProfile(). |
| 437 | 438 |
| 438 g_browser_process->platform_part()->InitializeChromeUserManager(); | 439 g_browser_process->platform_part()->InitializeChromeUserManager(); |
| 440 g_browser_process->platform_part()->CreateSessionManager(); |
| 439 | 441 |
| 440 ScreenLocker::InitClass(); | 442 ScreenLocker::InitClass(); |
| 441 | 443 |
| 442 // This forces the ProfileManager to be created and register for the | 444 // This forces the ProfileManager to be created and register for the |
| 443 // notification it needs to track the logged in user. | 445 // notification it needs to track the logged in user. |
| 444 g_browser_process->profile_manager(); | 446 g_browser_process->profile_manager(); |
| 445 | 447 |
| 446 // AccessibilityManager and SystemKeyEventListener use InputMethodManager. | 448 // AccessibilityManager and SystemKeyEventListener use InputMethodManager. |
| 447 input_method::Initialize(); | 449 input_method::Initialize(); |
| 448 | 450 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 // possible when we are restoring session or skipping login screen for some | 630 // possible when we are restoring session or skipping login screen for some |
| 629 // other reason. | 631 // other reason. |
| 630 chromeos::ProfileHelper::GetSigninProfile(); | 632 chromeos::ProfileHelper::GetSigninProfile(); |
| 631 } | 633 } |
| 632 | 634 |
| 633 BootTimesRecorder::Get()->OnChromeProcessStart(); | 635 BootTimesRecorder::Get()->OnChromeProcessStart(); |
| 634 | 636 |
| 635 // Initialize the network portal detector for Chrome OS. The network | 637 // Initialize the network portal detector for Chrome OS. The network |
| 636 // portal detector starts to listen for notifications from | 638 // portal detector starts to listen for notifications from |
| 637 // NetworkStateHandler and initiates captive portal detection for | 639 // NetworkStateHandler and initiates captive portal detection for |
| 638 // active networks. Should be called before call to CreateSessionManager, | 640 // active networks. Should be called before call to initialize |
| 639 // because it depends on NetworkPortalDetector. | 641 // ChromeSessionManager because it depends on NetworkPortalDetector. |
| 640 InitializeNetworkPortalDetector(); | 642 InitializeNetworkPortalDetector(); |
| 641 { | 643 { |
| 642 #if defined(GOOGLE_CHROME_BUILD) | 644 #if defined(GOOGLE_CHROME_BUILD) |
| 643 bool is_official_build = true; | 645 bool is_official_build = true; |
| 644 #else | 646 #else |
| 645 bool is_official_build = false; | 647 bool is_official_build = false; |
| 646 #endif | 648 #endif |
| 647 // Enable portal detector if EULA was previously accepted or if | 649 // Enable portal detector if EULA was previously accepted or if |
| 648 // this is an unofficial build. | 650 // this is an unofficial build. |
| 649 if (!is_official_build || StartupUtils::IsEulaAccepted()) | 651 if (!is_official_build || StartupUtils::IsEulaAccepted()) |
| 650 network_portal_detector::GetInstance()->Enable(true); | 652 network_portal_detector::GetInstance()->Enable(true); |
| 651 } | 653 } |
| 652 | 654 |
| 653 // Initialize input methods. | 655 // Initialize input methods. |
| 654 input_method::InputMethodManager* manager = | 656 input_method::InputMethodManager* manager = |
| 655 input_method::InputMethodManager::Get(); | 657 input_method::InputMethodManager::Get(); |
| 656 UserSessionManager* session_manager = UserSessionManager::GetInstance(); | 658 UserSessionManager* session_manager = UserSessionManager::GetInstance(); |
| 657 DCHECK(manager); | 659 DCHECK(manager); |
| 658 DCHECK(session_manager); | 660 DCHECK(session_manager); |
| 659 | 661 |
| 660 manager->SetState(session_manager->GetDefaultIMEState(profile())); | 662 manager->SetState(session_manager->GetDefaultIMEState(profile())); |
| 661 | 663 |
| 662 bool is_running_test = parameters().ui_task != nullptr; | 664 bool is_running_test = parameters().ui_task != nullptr; |
| 663 g_browser_process->platform_part()->InitializeSessionManager( | 665 g_browser_process->platform_part()->session_manager()->Initialize( |
| 664 parsed_command_line(), profile(), is_running_test); | 666 parsed_command_line(), profile(), is_running_test); |
| 665 g_browser_process->platform_part()->SessionManager()->Start(); | |
| 666 | 667 |
| 667 // Guest user profile is never initialized with locale settings, | 668 // Guest user profile is never initialized with locale settings, |
| 668 // so we need special handling for Guest session. | 669 // so we need special handling for Guest session. |
| 669 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) | 670 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) |
| 670 SetGuestLocale(profile()); | 671 SetGuestLocale(profile()); |
| 671 | 672 |
| 672 // This observer uses the intialized profile to dispatch extension events. | 673 // This observer uses the intialized profile to dispatch extension events. |
| 673 extension_volume_observer_ = base::MakeUnique<ExtensionVolumeObserver>(); | 674 extension_volume_observer_ = base::MakeUnique<ExtensionVolumeObserver>(); |
| 674 | 675 |
| 675 peripheral_battery_observer_ = base::MakeUnique<PeripheralBatteryObserver>(); | 676 peripheral_battery_observer_ = base::MakeUnique<PeripheralBatteryObserver>(); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 CrasAudioHandler::Shutdown(); | 871 CrasAudioHandler::Shutdown(); |
| 871 | 872 |
| 872 quirks::QuirksManager::Shutdown(); | 873 quirks::QuirksManager::Shutdown(); |
| 873 | 874 |
| 874 // Called after | 875 // Called after |
| 875 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() to be | 876 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() to be |
| 876 // executed after execution of chrome::CloseAsh(), because some | 877 // executed after execution of chrome::CloseAsh(), because some |
| 877 // parts of WebUI depends on NetworkPortalDetector. | 878 // parts of WebUI depends on NetworkPortalDetector. |
| 878 network_portal_detector::Shutdown(); | 879 network_portal_detector::Shutdown(); |
| 879 | 880 |
| 881 g_browser_process->platform_part()->ShutdownSessionManager(); |
| 880 g_browser_process->platform_part()->DestroyChromeUserManager(); | 882 g_browser_process->platform_part()->DestroyChromeUserManager(); |
| 881 | |
| 882 g_browser_process->platform_part()->ShutdownSessionManager(); | |
| 883 } | 883 } |
| 884 | 884 |
| 885 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { | 885 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { |
| 886 // Destroy DBus services immediately after threads are stopped. | 886 // Destroy DBus services immediately after threads are stopped. |
| 887 dbus_services_.reset(); | 887 dbus_services_.reset(); |
| 888 | 888 |
| 889 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 889 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 890 | 890 |
| 891 // Destroy DeviceSettingsService after g_browser_process. | 891 // Destroy DeviceSettingsService after g_browser_process. |
| 892 DeviceSettingsService::Shutdown(); | 892 DeviceSettingsService::Shutdown(); |
| 893 } | 893 } |
| 894 | 894 |
| 895 } // namespace chromeos | 895 } // namespace chromeos |
| OLD | NEW |