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

Unified Diff: chrome/browser/sessions/session_service.h

Issue 362016: Mac: don't restore explicitly closed windows. (Closed)
Patch Set: Updated comment per sky's re-review. Created 11 years, 1 month 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/defaults.cc ('k') | chrome/browser/sessions/session_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_service.h
diff --git a/chrome/browser/sessions/session_service.h b/chrome/browser/sessions/session_service.h
index d1b5f05bb2fdee81fbb87b990c4030cc2cd37dc8..98276fe4c83028ea1ad5c36a964eeb5138e8e24a 100644
--- a/chrome/browser/sessions/session_service.h
+++ b/chrome/browser/sessions/session_service.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "chrome/browser/browser.h"
+#include "chrome/browser/browser_list.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/sessions/base_session_service.h"
#include "chrome/browser/sessions/session_id.h"
@@ -330,6 +331,18 @@ class SessionService : public BaseSessionService,
(type == Browser::TYPE_POPUP && browser_defaults::kRestorePopups);
}
+ // Returns true if we should record a window close as pending.
+ // |has_open_trackable_browsers_| must be up-to-date before calling this.
+ bool should_record_close_as_pending() const {
+ // When this is called, the browser window being closed is still open, hence
+ // still in the browser list. If there is a browser window other than the
+ // one being closed but no trackable windows, then the others must be App
+ // windows or similar. In this case, we record the close as pending.
+ return !has_open_trackable_browsers_ &&
+ (!browser_defaults::kBrowserAliveWithNoWindows ||
+ BrowserList::size() > 1);
+ }
+
// Convert back/forward between the Browser and SessionService DB window
// types.
static WindowType WindowTypeForBrowserType(Browser::Type type);
« no previous file with comments | « chrome/browser/defaults.cc ('k') | chrome/browser/sessions/session_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698