Index: chrome/browser/ui/apps/chrome_app_delegate.cc |
diff --git a/chrome/browser/ui/apps/chrome_app_delegate.cc b/chrome/browser/ui/apps/chrome_app_delegate.cc |
index 8ed8e7f68876af90a12faf4a624659fe591ebf92..7977f45e2982debd5cca1573c37388ec144ee862 100644 |
--- a/chrome/browser/ui/apps/chrome_app_delegate.cc |
+++ b/chrome/browser/ui/apps/chrome_app_delegate.cc |
@@ -10,11 +10,12 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/strings/stringprintf.h" |
#include "chrome/browser/app_mode/app_mode_utils.h" |
-#include "chrome/browser/apps/scoped_keep_alive.h" |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
#include "chrome/browser/favicon/favicon_utils.h" |
#include "chrome/browser/file_select_helper.h" |
+#include "chrome/browser/lifetime/keep_alive_types.h" |
+#include "chrome/browser/lifetime/scoped_keep_alive.h" |
#include "chrome/browser/media/media_capture_devices_dispatcher.h" |
#include "chrome/browser/platform_util.h" |
#include "chrome/browser/profiles/profile.h" |
@@ -167,12 +168,15 @@ ChromeAppDelegate::NewWindowContentsDelegate::OpenURLFromTab( |
return NULL; |
} |
-ChromeAppDelegate::ChromeAppDelegate(scoped_ptr<ScopedKeepAlive> keep_alive) |
+ChromeAppDelegate::ChromeAppDelegate(bool keep_alive) |
: has_been_shown_(false), |
is_hidden_(true), |
- keep_alive_(std::move(keep_alive)), |
new_window_contents_delegate_(new NewWindowContentsDelegate()), |
weak_factory_(this) { |
+ if (keep_alive) { |
+ keep_alive_.reset( |
+ new ScopedKeepAlive(KeepAliveOrigin::CHROME_APP_DELEGATE)); |
+ } |
registrar_.Add(this, |
chrome::NOTIFICATION_APP_TERMINATING, |
content::NotificationService::AllSources()); |
@@ -345,7 +349,7 @@ void ChromeAppDelegate::OnHide() { |
void ChromeAppDelegate::OnShow() { |
has_been_shown_ = true; |
is_hidden_ = false; |
- keep_alive_.reset(new ScopedKeepAlive); |
+ keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::CHROME_APP_DELEGATE)); |
} |
void ChromeAppDelegate::Observe(int type, |