Chromium Code Reviews| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "apps/app_restore_service.h" | 10 #include "apps/app_restore_service.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 #if defined(OS_MACOSX) | 94 #if defined(OS_MACOSX) |
| 95 #include "base/mac/mac_util.h" | 95 #include "base/mac/mac_util.h" |
| 96 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" | 96 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" |
| 97 #endif | 97 #endif |
| 98 | 98 |
| 99 #if defined(TOOLKIT_GTK) | 99 #if defined(TOOLKIT_GTK) |
| 100 #include "chrome/browser/ui/gtk/gtk_util.h" | 100 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 101 #endif | 101 #endif |
| 102 | 102 |
| 103 #if defined(OS_WIN) | 103 #if defined(OS_WIN) |
| 104 #include "apps/app_launch_on_restart_service_win.h" | |
| 104 #include "base/win/windows_version.h" | 105 #include "base/win/windows_version.h" |
| 105 #endif | 106 #endif |
| 106 | 107 |
| 107 using content::ChildProcessSecurityPolicy; | 108 using content::ChildProcessSecurityPolicy; |
| 108 using content::WebContents; | 109 using content::WebContents; |
| 109 using extensions::Extension; | 110 using extensions::Extension; |
| 110 | 111 |
| 111 namespace { | 112 namespace { |
| 112 | 113 |
| 113 // Utility functions ---------------------------------------------------------- | 114 // Utility functions ---------------------------------------------------------- |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 623 apps::AppRestoreServiceFactory::GetForProfile(profile_); | 624 apps::AppRestoreServiceFactory::GetForProfile(profile_); |
| 624 // NULL in incognito mode. | 625 // NULL in incognito mode. |
| 625 if (service) { | 626 if (service) { |
| 626 bool should_restore_apps = StartupBrowserCreator::WasRestarted(); | 627 bool should_restore_apps = StartupBrowserCreator::WasRestarted(); |
| 627 #if defined(OS_CHROMEOS) | 628 #if defined(OS_CHROMEOS) |
| 628 // Chromeos always restarts apps, even if it was a regular shutdown. | 629 // Chromeos always restarts apps, even if it was a regular shutdown. |
| 629 should_restore_apps = true; | 630 should_restore_apps = true; |
| 630 #endif | 631 #endif |
| 631 service->HandleStartup(should_restore_apps); | 632 service->HandleStartup(should_restore_apps); |
| 632 } | 633 } |
| 634 | |
| 635 #if defined(OS_WIN) | |
| 636 apps::AppLaunchOnRestartServiceWin::HandleStartupForProfile(profile_); | |
|
tapted
2013/03/19 02:49:05
This function is only called if process_startup is
| |
| 637 #endif | |
| 638 | |
| 633 if (pref.type == SessionStartupPref::LAST) { | 639 if (pref.type == SessionStartupPref::LAST) { |
| 634 if (profile_->GetLastSessionExitType() == Profile::EXIT_CRASHED && | 640 if (profile_->GetLastSessionExitType() == Profile::EXIT_CRASHED && |
| 635 !command_line_.HasSwitch(switches::kRestoreLastSession)) { | 641 !command_line_.HasSwitch(switches::kRestoreLastSession)) { |
| 636 // The last session crashed. It's possible automatically loading the | 642 // The last session crashed. It's possible automatically loading the |
| 637 // page will trigger another crash, locking the user out of chrome. | 643 // page will trigger another crash, locking the user out of chrome. |
| 638 // To avoid this, don't restore on startup but instead show the crashed | 644 // To avoid this, don't restore on startup but instead show the crashed |
| 639 // infobar. | 645 // infobar. |
| 640 VLOG(1) << "Unclean exit; not processing"; | 646 VLOG(1) << "Unclean exit; not processing"; |
| 641 return false; | 647 return false; |
| 642 } | 648 } |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 943 } | 949 } |
| 944 | 950 |
| 945 #if !defined(OS_WIN) || defined(USE_AURA) | 951 #if !defined(OS_WIN) || defined(USE_AURA) |
| 946 // static | 952 // static |
| 947 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | 953 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |
| 948 Profile* profile, | 954 Profile* profile, |
| 949 const std::vector<GURL>& startup_urls) { | 955 const std::vector<GURL>& startup_urls) { |
| 950 return false; | 956 return false; |
| 951 } | 957 } |
| 952 #endif | 958 #endif |
| OLD | NEW |