Index: chrome/browser/app_controller_mac.mm |
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm |
index 78d27e24bfe65d7ece00191b85791a9638cee468..5865949c4d065f45a47bc80cef1a71a3995a8cca 100644 |
--- a/chrome/browser/app_controller_mac.mm |
+++ b/chrome/browser/app_controller_mac.mm |
@@ -1274,18 +1274,25 @@ class AppControllerProfileObserver : public ProfileAttributesStorage::Observer { |
return; |
} |
+ chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? |
+ chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; |
+ StartupBrowserCreatorImpl launch(base::FilePath(), |
+ *base::CommandLine::ForCurrentProcess(), |
+ first_run); |
Browser* browser = chrome::GetLastActiveBrowser(); |
- // if no browser window exists then create one with no tabs to be filled in |
+ bool show_browser = false; |
if (!browser) { |
browser = new Browser(Browser::CreateParams([self lastProfile], true)); |
- browser->window()->Show(); |
+ show_browser = true; |
+ } |
+ if (launch.WillRestoreSession(browser, [self lastProfile], false, urls)) { |
+ launch.OpenURLsAfterSessionRestore(browser, false, urls); |
+ } else { |
+ // if no browser window exists then create one with no tabs to be filled in |
+ if (show_browser) |
+ browser->window()->Show(); |
+ launch.OpenURLsInBrowser(browser, false, urls); |
} |
- |
- base::CommandLine dummy(base::CommandLine::NO_PROGRAM); |
- chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? |
- chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; |
- StartupBrowserCreatorImpl launch(base::FilePath(), dummy, first_run); |
- launch.OpenURLsInBrowser(browser, false, urls); |
} |
- (void)getUrl:(NSAppleEventDescriptor*)event |