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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 83 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
84 #include "chrome/browser/chromeos/resource_reporter/resource_reporter.h" | 84 #include "chrome/browser/chromeos/resource_reporter/resource_reporter.h" |
85 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h " | 85 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h " |
86 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 86 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
87 #include "chrome/browser/chromeos/settings/shutdown_policy_forwarder.h" | 87 #include "chrome/browser/chromeos/settings/shutdown_policy_forwarder.h" |
88 #include "chrome/browser/chromeos/status/data_promo_notification.h" | 88 #include "chrome/browser/chromeos/status/data_promo_notification.h" |
89 #include "chrome/browser/chromeos/system/input_device_settings.h" | 89 #include "chrome/browser/chromeos/system/input_device_settings.h" |
90 #include "chrome/browser/chromeos/ui/low_disk_notification.h" | 90 #include "chrome/browser/chromeos/ui/low_disk_notification.h" |
91 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" | 91 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" |
92 #include "chrome/browser/defaults.h" | 92 #include "chrome/browser/defaults.h" |
93 #include "chrome/browser/extensions/extension_error_reporter.h" | |
93 #include "chrome/browser/lifetime/application_lifetime.h" | 94 #include "chrome/browser/lifetime/application_lifetime.h" |
94 #include "chrome/browser/net/chrome_network_delegate.h" | 95 #include "chrome/browser/net/chrome_network_delegate.h" |
95 #include "chrome/browser/profiles/profile.h" | 96 #include "chrome/browser/profiles/profile.h" |
96 #include "chrome/browser/profiles/profile_manager.h" | 97 #include "chrome/browser/profiles/profile_manager.h" |
97 #include "chrome/browser/task_manager/task_manager_interface.h" | 98 #include "chrome/browser/task_manager/task_manager_interface.h" |
98 #include "chrome/browser/ui/ash/ash_util.h" | 99 #include "chrome/browser/ui/ash/ash_util.h" |
99 #include "chrome/common/channel_info.h" | 100 #include "chrome/common/channel_info.h" |
100 #include "chrome/common/chrome_constants.h" | 101 #include "chrome/common/chrome_constants.h" |
101 #include "chrome/common/chrome_paths.h" | 102 #include "chrome/common/chrome_paths.h" |
102 #include "chrome/common/chrome_switches.h" | 103 #include "chrome/common/chrome_switches.h" |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
741 | 742 |
742 // Initialize input methods. | 743 // Initialize input methods. |
743 input_method::InputMethodManager* manager = | 744 input_method::InputMethodManager* manager = |
744 input_method::InputMethodManager::Get(); | 745 input_method::InputMethodManager::Get(); |
745 UserSessionManager* session_manager = UserSessionManager::GetInstance(); | 746 UserSessionManager* session_manager = UserSessionManager::GetInstance(); |
746 DCHECK(manager); | 747 DCHECK(manager); |
747 DCHECK(session_manager); | 748 DCHECK(session_manager); |
748 | 749 |
749 manager->SetState(session_manager->GetDefaultIMEState(profile())); | 750 manager->SetState(session_manager->GetDefaultIMEState(profile())); |
750 | 751 |
752 // Safe to show postponed extension error messages (if any) now, if it's the | |
753 // signin profile, or a profile associated with the active user. Because | |
754 // extension errors are reported in context of active user, they should be | |
755 // postponed until input methods of the active user is initializd. | |
756 if (ProfileHelper::IsSigninProfile(profile()) || | |
tbarzic
2017/04/25 22:25:54
Isn't this code run only for default profile (whic
| |
757 ProfileHelper::Get()->GetUserByProfile(profile())->is_active()) { | |
758 ExtensionErrorReporter::GetInstance()->ShowPostponedMessages(); | |
759 } | |
760 | |
751 bool is_running_test = parameters().ui_task != nullptr; | 761 bool is_running_test = parameters().ui_task != nullptr; |
752 g_browser_process->platform_part()->session_manager()->Initialize( | 762 g_browser_process->platform_part()->session_manager()->Initialize( |
753 parsed_command_line(), profile(), is_running_test); | 763 parsed_command_line(), profile(), is_running_test); |
754 | 764 |
755 // Guest user profile is never initialized with locale settings, | 765 // Guest user profile is never initialized with locale settings, |
756 // so we need special handling for Guest session. | 766 // so we need special handling for Guest session. |
757 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) | 767 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) |
758 SetGuestLocale(profile()); | 768 SetGuestLocale(profile()); |
759 | 769 |
760 // This observer uses the intialized profile to dispatch extension events. | 770 // This observer uses the intialized profile to dispatch extension events. |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
991 | 1001 |
992 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 1002 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
993 | 1003 |
994 // Destroy DeviceSettingsService after g_browser_process. | 1004 // Destroy DeviceSettingsService after g_browser_process. |
995 DeviceSettingsService::Shutdown(); | 1005 DeviceSettingsService::Shutdown(); |
996 | 1006 |
997 chromeos::ShutdownCloseTracking(); | 1007 chromeos::ShutdownCloseTracking(); |
998 } | 1008 } |
999 | 1009 |
1000 } // namespace chromeos | 1010 } // namespace chromeos |
OLD | NEW |