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

Unified Diff: chrome/browser/ui/apps/chrome_app_delegate.cc

Issue 1708343002: Add ScopedKeepAlive to c/b/lifetime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove KeepAliveOrigin::TEST Created 4 years, 10 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/ui/apps/chrome_app_delegate.h ('k') | chrome/browser/ui/apps/chrome_app_window_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « chrome/browser/ui/apps/chrome_app_delegate.h ('k') | chrome/browser/ui/apps/chrome_app_window_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698