| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 master_settings_->GetUrlsToRestoreOnStartup()); | 268 master_settings_->GetUrlsToRestoreOnStartup()); |
| 269 if (url_list) | 269 if (url_list) |
| 270 ListPrefUpdate(prefs, prefs::kURLsToRestoreOnStartup)->Swap(url_list.get()); | 270 ListPrefUpdate(prefs, prefs::kURLsToRestoreOnStartup)->Swap(url_list.get()); |
| 271 | 271 |
| 272 int restore_on_startup; | 272 int restore_on_startup; |
| 273 if (master_settings_->GetRestoreOnStartup(&restore_on_startup)) | 273 if (master_settings_->GetRestoreOnStartup(&restore_on_startup)) |
| 274 prefs->SetInteger(prefs::kRestoreOnStartup, restore_on_startup); | 274 prefs->SetInteger(prefs::kRestoreOnStartup, restore_on_startup); |
| 275 else | 275 else |
| 276 prefs->ClearPref(prefs::kRestoreOnStartup); | 276 prefs->ClearPref(prefs::kRestoreOnStartup); |
| 277 | 277 |
| 278 prefs->SetBoolean(prefs::kRestoreOnStartupMigrated, true); | |
| 279 MarkAsDone(STARTUP_PAGES); | 278 MarkAsDone(STARTUP_PAGES); |
| 280 } | 279 } |
| 281 | 280 |
| 282 void ProfileResetter::ResetPinnedTabs() { | 281 void ProfileResetter::ResetPinnedTabs() { |
| 283 // Unpin all the tabs. | 282 // Unpin all the tabs. |
| 284 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 283 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
| 285 if (it->is_type_tabbed() && it->profile() == profile_) { | 284 if (it->is_type_tabbed() && it->profile() == profile_) { |
| 286 TabStripModel* tab_model = it->tab_strip_model(); | 285 TabStripModel* tab_model = it->tab_strip_model(); |
| 287 // Here we assume that indexof(any mini tab) < indexof(any normal tab). | 286 // Here we assume that indexof(any mini tab) < indexof(any normal tab). |
| 288 // If we unpin the tab, it can be moved to the right. Thus traversing in | 287 // 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... |
| 346 chrome_exe, | 345 chrome_exe, |
| 347 false, | 346 false, |
| 348 cancel, | 347 cancel, |
| 349 &shortcuts); | 348 &shortcuts); |
| 350 } | 349 } |
| 351 return shortcuts; | 350 return shortcuts; |
| 352 #else | 351 #else |
| 353 return std::vector<ShortcutCommand>(); | 352 return std::vector<ShortcutCommand>(); |
| 354 #endif | 353 #endif |
| 355 } | 354 } |
| OLD | NEW |