OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |