| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/browser_init.h" | 5 #include "chrome/browser/ui/browser_init.h" |
| 6 | 6 |
| 7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
| 8 | 8 |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/event_recorder.h" | 10 #include "base/event_recorder.h" |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 // Session restore didn't occur, open the urls. | 883 // Session restore didn't occur, open the urls. |
| 884 | 884 |
| 885 Browser* browser = NULL; | 885 Browser* browser = NULL; |
| 886 std::vector<GURL> adjust_urls = urls_to_open; | 886 std::vector<GURL> adjust_urls = urls_to_open; |
| 887 if (adjust_urls.empty()) | 887 if (adjust_urls.empty()) |
| 888 AddStartupURLs(&adjust_urls); | 888 AddStartupURLs(&adjust_urls); |
| 889 else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) | 889 else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) |
| 890 browser = BrowserList::GetLastActiveWithProfile(profile_); | 890 browser = BrowserList::GetLastActiveWithProfile(profile_); |
| 891 | 891 |
| 892 browser = OpenURLsInBrowser(browser, process_startup, adjust_urls); | 892 browser = OpenURLsInBrowser(browser, process_startup, adjust_urls); |
| 893 AddInfoBarsIfNecessary(browser); | 893 if (process_startup) |
| 894 AddInfoBarsIfNecessary(browser); |
| 894 } | 895 } |
| 895 | 896 |
| 896 bool BrowserInit::LaunchWithProfile::ProcessStartupURLs( | 897 bool BrowserInit::LaunchWithProfile::ProcessStartupURLs( |
| 897 const std::vector<GURL>& urls_to_open) { | 898 const std::vector<GURL>& urls_to_open) { |
| 898 SessionStartupPref pref = GetSessionStartupPref(command_line_, profile_); | 899 SessionStartupPref pref = GetSessionStartupPref(command_line_, profile_); |
| 899 if (command_line_.HasSwitch(switches::kTestingChannelID) && | 900 if (command_line_.HasSwitch(switches::kTestingChannelID) && |
| 900 !command_line_.HasSwitch(switches::kRestoreLastSession) && | 901 !command_line_.HasSwitch(switches::kRestoreLastSession) && |
| 901 browser_defaults::kDefaultSessionStartupType != | 902 browser_defaults::kDefaultSessionStartupType != |
| 902 SessionStartupPref::DEFAULT) { | 903 SessionStartupPref::DEFAULT) { |
| 903 // When we have non DEFAULT session start type, then we won't open up a | 904 // When we have non DEFAULT session start type, then we won't open up a |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 return false; | 1381 return false; |
| 1381 automation->SetExpectedTabCount(expected_tabs); | 1382 automation->SetExpectedTabCount(expected_tabs); |
| 1382 | 1383 |
| 1383 AutomationProviderList* list = | 1384 AutomationProviderList* list = |
| 1384 g_browser_process->InitAutomationProviderList(); | 1385 g_browser_process->InitAutomationProviderList(); |
| 1385 DCHECK(list); | 1386 DCHECK(list); |
| 1386 list->AddProvider(automation); | 1387 list->AddProvider(automation); |
| 1387 | 1388 |
| 1388 return true; | 1389 return true; |
| 1389 } | 1390 } |
| OLD | NEW |