| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sessions/session_restore.h" | 5 #include "chrome/browser/sessions/session_restore.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 | 744 |
| 745 // Appends the urls in |urls| to |browser|. | 745 // Appends the urls in |urls| to |browser|. |
| 746 void AppendURLsToBrowser(Browser* browser, | 746 void AppendURLsToBrowser(Browser* browser, |
| 747 const std::vector<GURL>& urls) { | 747 const std::vector<GURL>& urls) { |
| 748 for (size_t i = 0; i < urls.size(); ++i) { | 748 for (size_t i = 0; i < urls.size(); ++i) { |
| 749 int add_types = TabStripModel::ADD_FORCE_INDEX; | 749 int add_types = TabStripModel::ADD_FORCE_INDEX; |
| 750 if (i == 0) | 750 if (i == 0) |
| 751 add_types |= TabStripModel::ADD_ACTIVE; | 751 add_types |= TabStripModel::ADD_ACTIVE; |
| 752 int index = browser->GetIndexForInsertionDuringRestore(i); | 752 int index = browser->GetIndexForInsertionDuringRestore(i); |
| 753 browser::NavigateParams params(browser, urls[i], | 753 browser::NavigateParams params(browser, urls[i], |
| 754 PageTransition::START_PAGE); | 754 content::PAGE_TRANSITION_START_PAGE); |
| 755 params.disposition = i == 0 ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; | 755 params.disposition = i == 0 ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; |
| 756 params.tabstrip_index = index; | 756 params.tabstrip_index = index; |
| 757 params.tabstrip_add_types = add_types; | 757 params.tabstrip_add_types = add_types; |
| 758 browser::Navigate(¶ms); | 758 browser::Navigate(¶ms); |
| 759 } | 759 } |
| 760 } | 760 } |
| 761 | 761 |
| 762 // Invokes TabRestored on the SessionService for all tabs in browser after | 762 // Invokes TabRestored on the SessionService for all tabs in browser after |
| 763 // initial_count. | 763 // initial_count. |
| 764 void NotifySessionServiceOfRestoredTabs(Browser* browser, int initial_count) { | 764 void NotifySessionServiceOfRestoredTabs(Browser* browser, int initial_count) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 std::vector<GURL> gurls; | 858 std::vector<GURL> gurls; |
| 859 SessionRestoreImpl restorer(profile, | 859 SessionRestoreImpl restorer(profile, |
| 860 static_cast<Browser*>(NULL), true, false, true, gurls); | 860 static_cast<Browser*>(NULL), true, false, true, gurls); |
| 861 restorer.RestoreForeignTab(tab); | 861 restorer.RestoreForeignTab(tab); |
| 862 } | 862 } |
| 863 | 863 |
| 864 // static | 864 // static |
| 865 bool SessionRestore::IsRestoring() { | 865 bool SessionRestore::IsRestoring() { |
| 866 return restoring; | 866 return restoring; |
| 867 } | 867 } |
| OLD | NEW |