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

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

Issue 340023: Fix window restore behaviour on Mac. (Closed)
Patch Set: Fix namespace naming Created 11 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
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_service.cc
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index 31c296628c91cf8dbbd6992b034f20e97c1cf9d0..4682ca380269dc3180a96be2469d35c05cd595fe 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -29,6 +29,10 @@
#include "chrome/common/notification_details.h"
#include "chrome/common/notification_service.h"
+#if defined(OS_MACOSX)
+#include "chrome/browser/app_controller_cppsafe_mac.h"
+#endif
+
using base::Time;
// Identifier for commands written to file.
@@ -409,7 +413,14 @@ void SessionService::Observe(NotificationType type,
return;
}
- if (!has_open_trackable_browsers_ && !BrowserInit::InProcessStartup()) {
+ if (!has_open_trackable_browsers_ && !BrowserInit::InProcessStartup()
+#if defined(OS_MACOSX)
+ // OSX has a fairly different idea of application lifetime than the
+ // other platforms. We need to check that we aren't opening a window
+ // from the dock or the menubar.
+ && !app_controller_mac::IsOpeningNewWindow()
+#endif
+ ) {
// We're going from no tabbed browsers to a tabbed browser (and not in
// process startup), restore the last session.
if (move_on_new_browser_) {
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698