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/ui/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 SessionStartupPref pref = | 975 SessionStartupPref pref = |
976 StartupBrowserCreator::GetSessionStartupPref(command_line_, profile_); | 976 StartupBrowserCreator::GetSessionStartupPref(command_line_, profile_); |
977 if (pref.type == SessionStartupPref::LAST) | 977 if (pref.type == SessionStartupPref::LAST) |
978 VLOG(1) << "Pref: last"; | 978 VLOG(1) << "Pref: last"; |
979 else if (pref.type == SessionStartupPref::URLS) | 979 else if (pref.type == SessionStartupPref::URLS) |
980 VLOG(1) << "Pref: urls"; | 980 VLOG(1) << "Pref: urls"; |
981 else if (pref.type == SessionStartupPref::DEFAULT) | 981 else if (pref.type == SessionStartupPref::DEFAULT) |
982 VLOG(1) << "Pref: default"; | 982 VLOG(1) << "Pref: default"; |
983 | 983 |
984 apps::AppRestoreService* restore_service = | 984 apps::AppRestoreService* restore_service = |
985 apps::AppRestoreServiceFactory::GetForProfile(profile_); | 985 apps::AppRestoreServiceFactory::GetForBrowserContext(profile_); |
986 // NULL in incognito mode. | 986 // NULL in incognito mode. |
987 if (restore_service) { | 987 if (restore_service) { |
988 restore_service->HandleStartup(apps::AppRestoreService::ShouldRestoreApps( | 988 restore_service->HandleStartup(apps::AppRestoreService::ShouldRestoreApps( |
989 StartupBrowserCreator::WasRestarted())); | 989 StartupBrowserCreator::WasRestarted())); |
990 } | 990 } |
991 | 991 |
992 // Only activate the session restore logic if it is not the first run. It | 992 // Only activate the session restore logic if it is not the first run. It |
993 // makes really no sense to "restore" missing session. | 993 // makes really no sense to "restore" missing session. |
994 if (pref.type == SessionStartupPref::LAST && !is_first_run_) { | 994 if (pref.type == SessionStartupPref::LAST && !is_first_run_) { |
995 if (profile_->GetLastSessionExitType() == Profile::EXIT_CRASHED && | 995 if (profile_->GetLastSessionExitType() == Profile::EXIT_CRASHED && |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 #if defined(OS_WIN) | 1250 #if defined(OS_WIN) |
1251 TriggeredProfileResetter* triggered_profile_resetter = | 1251 TriggeredProfileResetter* triggered_profile_resetter = |
1252 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); | 1252 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); |
1253 // TriggeredProfileResetter instance will be nullptr for incognito profiles. | 1253 // TriggeredProfileResetter instance will be nullptr for incognito profiles. |
1254 if (triggered_profile_resetter) { | 1254 if (triggered_profile_resetter) { |
1255 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); | 1255 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); |
1256 } | 1256 } |
1257 #endif // defined(OS_WIN) | 1257 #endif // defined(OS_WIN) |
1258 return has_reset_trigger; | 1258 return has_reset_trigger; |
1259 } | 1259 } |
OLD | NEW |