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

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

Issue 557833007: Remove Increment/DecrementKeepAliveCount from AppsClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 3 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.h » ('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 f0c963601a0c46b518d5e26891ccc2eb06d4e093..5438d59839b61233b4a824f9a835827c36a05931 100644
--- a/chrome/browser/ui/apps/chrome_app_delegate.cc
+++ b/chrome/browser/ui/apps/chrome_app_delegate.cc
@@ -7,6 +7,7 @@
#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_tab_helper.h"
@@ -148,14 +149,17 @@ ChromeAppDelegate::NewWindowContentsDelegate::OpenURLFromTab(
return NULL;
}
-ChromeAppDelegate::ChromeAppDelegate()
- : new_window_contents_delegate_(new NewWindowContentsDelegate()) {
+ChromeAppDelegate::ChromeAppDelegate(scoped_ptr<ScopedKeepAlive> keep_alive)
+ : keep_alive_(keep_alive.Pass()),
+ new_window_contents_delegate_(new NewWindowContentsDelegate()) {
registrar_.Add(this,
chrome::NOTIFICATION_APP_TERMINATING,
content::NotificationService::AllSources());
}
ChromeAppDelegate::~ChromeAppDelegate() {
+ // Unregister now to prevent getting notified if |keep_alive_| is the last.
+ terminating_callback_.Reset();
}
void ChromeAppDelegate::DisableExternalOpenForTesting() {
« no previous file with comments | « chrome/browser/ui/apps/chrome_app_delegate.h ('k') | chrome/browser/ui/apps/chrome_app_window_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698