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

Side by Side Diff: chrome/browser/ui/browser_init.cc

Issue 10049005: Fix homepage migration for users who never changed their settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Value -> base::Value Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 the user had 'homepage' selected, we should have migrated them to 1197 // If 'homepage' selected, either by the user or by a policy, we should
1198 // 'URLs' instead. 1198 // have migrated them to another value.
1199 DLOG(ERROR) << "pref.type == HOMEPAGE"; 1199 NOTREACHED() << "SessionStartupPref has deprecated type HOMEPAGE";
1200 NOTREACHED();
1201 } 1200 }
1202 1201
1203 if (tabs.empty()) 1202 if (tabs.empty())
1204 return NULL; 1203 return NULL;
1205 1204
1206 Browser* browser = OpenTabsInBrowser(NULL, true, tabs); 1205 Browser* browser = OpenTabsInBrowser(NULL, true, tabs);
1207 return browser; 1206 return browser;
1208 } 1207 }
1209 1208
1210 void BrowserInit::LaunchWithProfile::AddUniqueURLs( 1209 void BrowserInit::LaunchWithProfile::AddUniqueURLs(
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1947 1946
1948 Profile* profile = ProfileManager::GetLastUsedProfile(); 1947 Profile* profile = ProfileManager::GetLastUsedProfile();
1949 if (!profile) { 1948 if (!profile) {
1950 // We should only be able to get here if the profile already exists and 1949 // We should only be able to get here if the profile already exists and
1951 // has been created. 1950 // has been created.
1952 NOTREACHED(); 1951 NOTREACHED();
1953 return; 1952 return;
1954 } 1953 }
1955 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); 1954 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL);
1956 } 1955 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698