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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 2798143004: Fix for URL opening code (Closed)
Patch Set: Created 3 years, 8 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/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

Powered by Google App Engine
This is Rietveld 408576698