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

Unified Diff: chrome/browser/prefs/session_startup_pref.cc

Issue 9583025: Revert 124583 (See crbug.com/114259) Original info for r124583 is: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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
« no previous file with comments | « chrome/browser/prefs/session_startup_pref.h ('k') | chrome/browser/prefs/session_startup_pref_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/session_startup_pref.cc
===================================================================
--- chrome/browser/prefs/session_startup_pref.cc (revision 124738)
+++ chrome/browser/prefs/session_startup_pref.cc (working copy)
@@ -6,7 +6,6 @@
#include <string>
-#include "base/values.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
@@ -21,7 +20,7 @@
// For historical reasons the enum and value registered in the prefs don't line
// up. These are the values registered in prefs.
-const int kPrefValueHomePage = 0; // Deprecated
+const int kPrefValueHomePage = 0;
const int kPrefValueLast = 1;
const int kPrefValueURLs = 4;
const int kPrefValueNewTab = 5;
@@ -29,19 +28,13 @@
// Converts a SessionStartupPref::Type to an integer written to prefs.
int TypeToPrefValue(SessionStartupPref::Type type) {
switch (type) {
+ case SessionStartupPref::HOMEPAGE: return kPrefValueHomePage;
case SessionStartupPref::LAST: return kPrefValueLast;
case SessionStartupPref::URLS: return kPrefValueURLs;
default: return kPrefValueNewTab;
}
}
-void SetNewUrlList(PrefService* prefs) {
- ListValue new_url_pref_list;
- StringValue* home_page = new StringValue(prefs->GetString(prefs::kHomePage));
- new_url_pref_list.Append(home_page);
- prefs->Set(prefs::kURLsToRestoreOnStartup, new_url_pref_list);
-}
-
} // namespace
// static
@@ -108,16 +101,6 @@
SessionStartupPref pref(
PrefValueToType(prefs->GetInteger(prefs::kRestoreOnStartup)));
- // Migrate from "Open the home page" to "Open the following URLs". If the user
- // had the "Open the homepage" option selected, then we need to switch them to
- // "Open the following URLs" and set the list of URLs to a list containing
- // just the user's homepage.
- if (pref.type == SessionStartupPref::HOMEPAGE) {
- prefs->SetInteger(prefs::kRestoreOnStartup, kPrefValueURLs);
- pref.type = SessionStartupPref::URLS;
- SetNewUrlList(prefs);
- }
-
// Always load the urls, even if the pref type isn't URLS. This way the
// preferences panels can show the user their last choice.
const ListValue* url_pref_list = prefs->GetList(
« no previous file with comments | « chrome/browser/prefs/session_startup_pref.h ('k') | chrome/browser/prefs/session_startup_pref_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698