Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3361)

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 10875027: Restart running apps when chrome restarts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_dependency_manager.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 5f5058416e18f5841c6b1891949d6209b45b9321..9e7aace570ea6f16b5ef738c7a542261564ec857 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -26,6 +26,8 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/defaults.h"
+#include "chrome/browser/extensions/app_restore_service.h"
+#include "chrome/browser/extensions/app_restore_service_factory.h"
#include "chrome/browser/extensions/extension_creator.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/pack_extension_job.h"
@@ -640,6 +642,11 @@ bool StartupBrowserCreatorImpl::ProcessStartupURLs(
else if (pref.type == SessionStartupPref::DEFAULT)
VLOG(1) << "Pref: default";
+ // The only time apps get restored is when the browser process is restarted.
+ if (StartupBrowserCreator::WasRestarted())
+ extensions::AppRestoreServiceFactory::GetForProfile(profile_)->
+ RestoreApps();
+
if (pref.type == SessionStartupPref::LAST) {
if (profile_->GetLastSessionExitType() == Profile::EXIT_CRASHED &&
!command_line_.HasSwitch(switches::kRestoreLastSession)) {
« no previous file with comments | « chrome/browser/profiles/profile_dependency_manager.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698