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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 // without valid navigations. In that case, just skip it. | 951 // without valid navigations. In that case, just skip it. |
952 // See crbug.com/154129. | 952 // See crbug.com/154129. |
953 if (tab.navigations.empty()) | 953 if (tab.navigations.empty()) |
954 return NULL; | 954 return NULL; |
955 int selected_index = tab.current_navigation_index; | 955 int selected_index = tab.current_navigation_index; |
956 selected_index = std::max( | 956 selected_index = std::max( |
957 0, | 957 0, |
958 std::min(selected_index, | 958 std::min(selected_index, |
959 static_cast<int>(tab.navigations.size() - 1))); | 959 static_cast<int>(tab.navigations.size() - 1))); |
960 | 960 |
| 961 LOG(ERROR) << "Restoring a tab, title: " |
| 962 << tab.navigations.at(selected_index).title(); |
961 RecordAppLaunchForTab(browser, tab, selected_index); | 963 RecordAppLaunchForTab(browser, tab, selected_index); |
962 | 964 |
963 // Associate sessionStorage (if any) to the restored tab. | 965 // Associate sessionStorage (if any) to the restored tab. |
964 scoped_refptr<content::SessionStorageNamespace> session_storage_namespace; | 966 scoped_refptr<content::SessionStorageNamespace> session_storage_namespace; |
965 if (!tab.session_storage_persistent_id.empty()) { | 967 if (!tab.session_storage_persistent_id.empty()) { |
966 session_storage_namespace = | 968 session_storage_namespace = |
967 content::BrowserContext::GetDefaultStoragePartition(profile_)-> | 969 content::BrowserContext::GetDefaultStoragePartition(profile_)-> |
968 GetDOMStorageContext()->RecreateSessionStorage( | 970 GetDOMStorageContext()->RecreateSessionStorage( |
969 tab.session_storage_persistent_id); | 971 tab.session_storage_persistent_id); |
970 } | 972 } |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 if (active_session_restorers == NULL) | 1187 if (active_session_restorers == NULL) |
1186 return false; | 1188 return false; |
1187 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1189 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1188 active_session_restorers->begin(); | 1190 active_session_restorers->begin(); |
1189 it != active_session_restorers->end(); ++it) { | 1191 it != active_session_restorers->end(); ++it) { |
1190 if ((*it)->profile() == profile) | 1192 if ((*it)->profile() == profile) |
1191 return true; | 1193 return true; |
1192 } | 1194 } |
1193 return false; | 1195 return false; |
1194 } | 1196 } |
OLD | NEW |