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

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

Issue 875273003: Hidden windows should not keep Chrome alive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually fix the ASAN issue. Created 5 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/apps/app_window_interactive_uitest.cc ('k') | chrome/browser/ui/apps/chrome_app_delegate.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.h
diff --git a/chrome/browser/ui/apps/chrome_app_delegate.h b/chrome/browser/ui/apps/chrome_app_delegate.h
index e1224a37e5f6ff1821da17c0889baf002ac64309..1a7ac1f1c5bc15163691981ac6008d50929fed3e 100644
--- a/chrome/browser/ui/apps/chrome_app_delegate.h
+++ b/chrome/browser/ui/apps/chrome_app_delegate.h
@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/app_window/app_delegate.h"
@@ -26,6 +27,9 @@ class ChromeAppDelegate : public extensions::AppDelegate,
static void DisableExternalOpenForTesting();
private:
+ static void RelinquishKeepAliveAfterTimeout(
+ const base::WeakPtr<ChromeAppDelegate>& chrome_app_delegate);
+
class NewWindowContentsDelegate;
// extensions::AppDelegate:
@@ -62,16 +66,21 @@ class ChromeAppDelegate : public extensions::AppDelegate,
bool blocked) override;
bool IsWebContentsVisible(content::WebContents* web_contents) override;
void SetTerminatingCallback(const base::Closure& callback) override;
+ void OnHide() override;
+ void OnShow() override;
// content::NotificationObserver:
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
+ bool has_been_shown_;
+ bool is_hidden_;
scoped_ptr<ScopedKeepAlive> keep_alive_;
scoped_ptr<NewWindowContentsDelegate> new_window_contents_delegate_;
base::Closure terminating_callback_;
content::NotificationRegistrar registrar_;
+ base::WeakPtrFactory<ChromeAppDelegate> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ChromeAppDelegate);
};
« no previous file with comments | « chrome/browser/apps/app_window_interactive_uitest.cc ('k') | chrome/browser/ui/apps/chrome_app_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698