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

Side by Side Diff: chrome/browser/profile_resetter/profile_resetter.cc

Issue 1312693005: Remove migration of obsolete value for "session.restore_on_startup". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@url-to-restore-on-startup
Patch Set: Re-enable the two tests Created 5 years 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/profile_resetter/profile_resetter.h" 5 #include "chrome/browser/profile_resetter/profile_resetter.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 master_settings_->GetUrlsToRestoreOnStartup()); 275 master_settings_->GetUrlsToRestoreOnStartup());
276 if (url_list) 276 if (url_list)
277 ListPrefUpdate(prefs, prefs::kURLsToRestoreOnStartup)->Swap(url_list.get()); 277 ListPrefUpdate(prefs, prefs::kURLsToRestoreOnStartup)->Swap(url_list.get());
278 278
279 int restore_on_startup; 279 int restore_on_startup;
280 if (master_settings_->GetRestoreOnStartup(&restore_on_startup)) 280 if (master_settings_->GetRestoreOnStartup(&restore_on_startup))
281 prefs->SetInteger(prefs::kRestoreOnStartup, restore_on_startup); 281 prefs->SetInteger(prefs::kRestoreOnStartup, restore_on_startup);
282 else 282 else
283 prefs->ClearPref(prefs::kRestoreOnStartup); 283 prefs->ClearPref(prefs::kRestoreOnStartup);
284 284
285 prefs->SetBoolean(prefs::kRestoreOnStartupMigrated, true);
286 MarkAsDone(STARTUP_PAGES); 285 MarkAsDone(STARTUP_PAGES);
287 } 286 }
288 287
289 void ProfileResetter::ResetPinnedTabs() { 288 void ProfileResetter::ResetPinnedTabs() {
290 // Unpin all the tabs. 289 // Unpin all the tabs.
291 for (chrome::BrowserIterator it; !it.done(); it.Next()) { 290 for (chrome::BrowserIterator it; !it.done(); it.Next()) {
292 if (it->is_type_tabbed() && it->profile() == profile_) { 291 if (it->is_type_tabbed() && it->profile() == profile_) {
293 TabStripModel* tab_model = it->tab_strip_model(); 292 TabStripModel* tab_model = it->tab_strip_model();
294 // Here we assume that indexof(any mini tab) < indexof(any normal tab). 293 // Here we assume that indexof(any mini tab) < indexof(any normal tab).
295 // If we unpin the tab, it can be moved to the right. Thus traversing in 294 // If we unpin the tab, it can be moved to the right. Thus traversing in
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 chrome_exe, 352 chrome_exe,
354 false, 353 false,
355 cancel, 354 cancel,
356 &shortcuts); 355 &shortcuts);
357 } 356 }
358 return shortcuts; 357 return shortcuts;
359 #else 358 #else
360 return std::vector<ShortcutCommand>(); 359 return std::vector<ShortcutCommand>();
361 #endif 360 #endif
362 } 361 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/session_startup_pref_unittest.cc ('k') | chrome/browser/sessions/restore_on_startup_policy_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698