OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 // Only use the set of urls specified in preferences if nothing was | 1187 // Only use the set of urls specified in preferences if nothing was |
1188 // specified on the command line. Filter out any urls that are to be | 1188 // specified on the command line. Filter out any urls that are to be |
1189 // restored by virtue of having been previously pinned. | 1189 // restored by virtue of having been previously pinned. |
1190 AddUniqueURLs(pref.urls, &tabs); | 1190 AddUniqueURLs(pref.urls, &tabs); |
1191 } else if (pref.type == SessionStartupPref::DEFAULT) { | 1191 } else if (pref.type == SessionStartupPref::DEFAULT) { |
1192 std::vector<GURL> urls; | 1192 std::vector<GURL> urls; |
1193 AddStartupURLs(&urls); | 1193 AddStartupURLs(&urls); |
1194 UrlsToTabs(urls, &tabs); | 1194 UrlsToTabs(urls, &tabs); |
1195 | 1195 |
1196 } else if (pref.type == SessionStartupPref::HOMEPAGE) { | 1196 } else if (pref.type == SessionStartupPref::HOMEPAGE) { |
1197 // If 'homepage' selected, either by the user or by a policy, we should | 1197 // If the user had 'homepage' selected, we should have migrated them to |
1198 // have migrated them to another value. | 1198 // 'URLs' instead. |
1199 NOTREACHED() << "SessionStartupPref has deprecated type HOMEPAGE"; | 1199 DLOG(ERROR) << "pref.type == HOMEPAGE"; |
| 1200 NOTREACHED(); |
1200 } | 1201 } |
1201 | 1202 |
1202 if (tabs.empty()) | 1203 if (tabs.empty()) |
1203 return NULL; | 1204 return NULL; |
1204 | 1205 |
1205 Browser* browser = OpenTabsInBrowser(NULL, true, tabs); | 1206 Browser* browser = OpenTabsInBrowser(NULL, true, tabs); |
1206 return browser; | 1207 return browser; |
1207 } | 1208 } |
1208 | 1209 |
1209 void BrowserInit::LaunchWithProfile::AddUniqueURLs( | 1210 void BrowserInit::LaunchWithProfile::AddUniqueURLs( |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1946 | 1947 |
1947 Profile* profile = ProfileManager::GetLastUsedProfile(); | 1948 Profile* profile = ProfileManager::GetLastUsedProfile(); |
1948 if (!profile) { | 1949 if (!profile) { |
1949 // We should only be able to get here if the profile already exists and | 1950 // We should only be able to get here if the profile already exists and |
1950 // has been created. | 1951 // has been created. |
1951 NOTREACHED(); | 1952 NOTREACHED(); |
1952 return; | 1953 return; |
1953 } | 1954 } |
1954 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); | 1955 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); |
1955 } | 1956 } |
OLD | NEW |