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

Unified Diff: chrome/browser/ui/views/auto_keep_alive.cc

Issue 1376063005: Cleanup: Pull some browser keep alive functions into its own file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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
Index: chrome/browser/ui/views/auto_keep_alive.cc
diff --git a/chrome/browser/ui/views/auto_keep_alive.cc b/chrome/browser/ui/views/auto_keep_alive.cc
index c7128e983f42d2d346c655574c26f50c22fbd385..4f45affac58ec15cd227b40a7a8c99de29a7b3ae 100644
--- a/chrome/browser/ui/views/auto_keep_alive.cc
+++ b/chrome/browser/ui/views/auto_keep_alive.cc
@@ -4,11 +4,10 @@
#include "chrome/browser/ui/views/auto_keep_alive.h"
-#include "chrome/browser/lifetime/application_lifetime.h"
+#include "chrome/browser/lifetime/browser_keep_alive.h"
#include "chrome/browser/ui/host_desktop.h"
-AutoKeepAlive::AutoKeepAlive(gfx::NativeWindow window)
- : keep_alive_available_(false) {
+AutoKeepAlive::AutoKeepAlive(gfx::NativeWindow window) {
// In case of aura we want default to be keep alive not available for ash
// because ash has keep alive set and we don't want additional keep alive
// count.
@@ -16,12 +15,10 @@ AutoKeepAlive::AutoKeepAlive(gfx::NativeWindow window)
window ? chrome::GetHostDesktopTypeForNativeWindow(window)
: chrome::GetActiveDesktop();
if (desktop_type != chrome::HOST_DESKTOP_TYPE_ASH) {
- keep_alive_available_ = true;
- chrome::IncrementKeepAliveCount();
+ keep_alive_.reset(new browser_lifetime::ScopedKeepAlive);
}
}
AutoKeepAlive::~AutoKeepAlive() {
- if (keep_alive_available_)
- chrome::DecrementKeepAliveCount();
+ keep_alive_.reset();
}
« no previous file with comments | « chrome/browser/ui/views/auto_keep_alive.h ('k') | chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698