| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 10 #include <string> |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 } | 959 } |
| 960 | 960 |
| 961 // Appends the urls in |urls| to |browser|. | 961 // Appends the urls in |urls| to |browser|. |
| 962 void AppendURLsToBrowser(Browser* browser, | 962 void AppendURLsToBrowser(Browser* browser, |
| 963 const std::vector<GURL>& urls) { | 963 const std::vector<GURL>& urls) { |
| 964 for (size_t i = 0; i < urls.size(); ++i) { | 964 for (size_t i = 0; i < urls.size(); ++i) { |
| 965 int add_types = TabStripModel::ADD_FORCE_INDEX; | 965 int add_types = TabStripModel::ADD_FORCE_INDEX; |
| 966 if (i == 0) | 966 if (i == 0) |
| 967 add_types |= TabStripModel::ADD_ACTIVE; | 967 add_types |= TabStripModel::ADD_ACTIVE; |
| 968 int index = chrome::GetIndexForInsertionDuringRestore(browser, i); | 968 int index = chrome::GetIndexForInsertionDuringRestore(browser, i); |
| 969 browser::NavigateParams params(browser, urls[i], | 969 chrome::NavigateParams params(browser, urls[i], |
| 970 content::PAGE_TRANSITION_START_PAGE); | 970 content::PAGE_TRANSITION_START_PAGE); |
| 971 params.disposition = i == 0 ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; | 971 params.disposition = i == 0 ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; |
| 972 params.tabstrip_index = index; | 972 params.tabstrip_index = index; |
| 973 params.tabstrip_add_types = add_types; | 973 params.tabstrip_add_types = add_types; |
| 974 browser::Navigate(¶ms); | 974 chrome::Navigate(¶ms); |
| 975 } | 975 } |
| 976 } | 976 } |
| 977 | 977 |
| 978 // Invokes TabRestored on the SessionService for all tabs in browser after | 978 // Invokes TabRestored on the SessionService for all tabs in browser after |
| 979 // initial_count. | 979 // initial_count. |
| 980 void NotifySessionServiceOfRestoredTabs(Browser* browser, int initial_count) { | 980 void NotifySessionServiceOfRestoredTabs(Browser* browser, int initial_count) { |
| 981 SessionService* session_service = | 981 SessionService* session_service = |
| 982 SessionServiceFactory::GetForProfile(profile_); | 982 SessionServiceFactory::GetForProfile(profile_); |
| 983 if (!session_service) | 983 if (!session_service) |
| 984 return; | 984 return; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 if (active_session_restorers == NULL) | 1089 if (active_session_restorers == NULL) |
| 1090 return false; | 1090 return false; |
| 1091 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1091 for (std::set<SessionRestoreImpl*>::const_iterator it = |
| 1092 active_session_restorers->begin(); | 1092 active_session_restorers->begin(); |
| 1093 it != active_session_restorers->end(); ++it) { | 1093 it != active_session_restorers->end(); ++it) { |
| 1094 if ((*it)->profile() == profile) | 1094 if ((*it)->profile() == profile) |
| 1095 return true; | 1095 return true; |
| 1096 } | 1096 } |
| 1097 return false; | 1097 return false; |
| 1098 } | 1098 } |
| OLD | NEW |