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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 #include "chrome/browser/performance_monitor/startup_timer.h" | 33 #include "chrome/browser/performance_monitor/startup_timer.h" |
34 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 34 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
35 #include "chrome/browser/prefs/pref_service.h" | 35 #include "chrome/browser/prefs/pref_service.h" |
36 #include "chrome/browser/prefs/session_startup_pref.h" | 36 #include "chrome/browser/prefs/session_startup_pref.h" |
37 #include "chrome/browser/profiles/profile.h" | 37 #include "chrome/browser/profiles/profile.h" |
38 #include "chrome/browser/profiles/profile_io_data.h" | 38 #include "chrome/browser/profiles/profile_io_data.h" |
39 #include "chrome/browser/protector/protected_prefs_watcher.h" | 39 #include "chrome/browser/protector/protected_prefs_watcher.h" |
40 #include "chrome/browser/protector/protector_service.h" | 40 #include "chrome/browser/protector/protector_service.h" |
41 #include "chrome/browser/protector/protector_service_factory.h" | 41 #include "chrome/browser/protector/protector_service_factory.h" |
42 #include "chrome/browser/protector/protector_utils.h" | 42 #include "chrome/browser/protector/protector_utils.h" |
43 #include "chrome/browser/sessions/app_restore_service.h" | |
44 #include "chrome/browser/sessions/app_restore_service_factory.h" | |
43 #include "chrome/browser/sessions/session_restore.h" | 45 #include "chrome/browser/sessions/session_restore.h" |
44 #include "chrome/browser/sessions/session_service.h" | 46 #include "chrome/browser/sessions/session_service.h" |
45 #include "chrome/browser/sessions/session_service_factory.h" | 47 #include "chrome/browser/sessions/session_service_factory.h" |
46 #include "chrome/browser/shell_integration.h" | 48 #include "chrome/browser/shell_integration.h" |
47 #include "chrome/browser/ui/browser_commands.h" | 49 #include "chrome/browser/ui/browser_commands.h" |
48 #include "chrome/browser/ui/browser_finder.h" | 50 #include "chrome/browser/ui/browser_finder.h" |
49 #include "chrome/browser/ui/browser_list.h" | 51 #include "chrome/browser/ui/browser_list.h" |
50 #include "chrome/browser/ui/browser_navigator.h" | 52 #include "chrome/browser/ui/browser_navigator.h" |
51 #include "chrome/browser/ui/browser_tabrestore.h" | 53 #include "chrome/browser/ui/browser_tabrestore.h" |
52 #include "chrome/browser/ui/browser_tabstrip.h" | 54 #include "chrome/browser/ui/browser_tabstrip.h" |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
591 VLOG(1) << "StartupBrowserCreatorImpl::ProcessStartupURLs"; | 593 VLOG(1) << "StartupBrowserCreatorImpl::ProcessStartupURLs"; |
592 SessionStartupPref pref = | 594 SessionStartupPref pref = |
593 StartupBrowserCreator::GetSessionStartupPref(command_line_, profile_); | 595 StartupBrowserCreator::GetSessionStartupPref(command_line_, profile_); |
594 if (pref.type == SessionStartupPref::LAST) | 596 if (pref.type == SessionStartupPref::LAST) |
595 VLOG(1) << "Pref: last"; | 597 VLOG(1) << "Pref: last"; |
596 else if (pref.type == SessionStartupPref::URLS) | 598 else if (pref.type == SessionStartupPref::URLS) |
597 VLOG(1) << "Pref: urls"; | 599 VLOG(1) << "Pref: urls"; |
598 else if (pref.type == SessionStartupPref::DEFAULT) | 600 else if (pref.type == SessionStartupPref::DEFAULT) |
599 VLOG(1) << "Pref: default"; | 601 VLOG(1) << "Pref: default"; |
600 | 602 |
603 LOG(ERROR) << "here"; | |
Mihai Parparita -not on Chrome
2012/09/04 04:14:48
Remove these.
koz (OOO until 15th September)
2012/09/04 07:10:20
Done.
| |
604 // The only time apps get restored is when the browser process is restarted. | |
605 if (StartupBrowserCreator::WasRestarted()) { | |
606 LOG(ERROR) << "here2"; | |
607 AppRestoreServiceFactory::GetForProfile(profile_)->RestoreApps(); | |
608 } | |
609 | |
601 if (pref.type == SessionStartupPref::LAST) { | 610 if (pref.type == SessionStartupPref::LAST) { |
602 if (!profile_->DidLastSessionExitCleanly() && | 611 if (!profile_->DidLastSessionExitCleanly() && |
603 !command_line_.HasSwitch(switches::kRestoreLastSession)) { | 612 !command_line_.HasSwitch(switches::kRestoreLastSession)) { |
604 // The last session crashed. It's possible automatically loading the | 613 // The last session crashed. It's possible automatically loading the |
605 // page will trigger another crash, locking the user out of chrome. | 614 // page will trigger another crash, locking the user out of chrome. |
606 // To avoid this, don't restore on startup but instead show the crashed | 615 // To avoid this, don't restore on startup but instead show the crashed |
607 // infobar. | 616 // infobar. |
608 VLOG(1) << "Unclean exit; not processing"; | 617 VLOG(1) << "Unclean exit; not processing"; |
609 return false; | 618 return false; |
610 } | 619 } |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
941 // New: | 950 // New: |
942 prefs->GetString(prefs::kHomePage), | 951 prefs->GetString(prefs::kHomePage), |
943 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 952 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
944 prefs->GetBoolean(prefs::kShowHomeButton), | 953 prefs->GetBoolean(prefs::kShowHomeButton), |
945 // Backup: | 954 // Backup: |
946 backup_homepage, | 955 backup_homepage, |
947 backup_homepage_is_ntp, | 956 backup_homepage_is_ntp, |
948 backup_show_home_button)); | 957 backup_show_home_button)); |
949 } | 958 } |
950 } | 959 } |
OLD | NEW |