| 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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 0, | 871 0, |
| 872 std::min(selected_index, | 872 std::min(selected_index, |
| 873 static_cast<int>(tab.navigations.size() - 1))); | 873 static_cast<int>(tab.navigations.size() - 1))); |
| 874 | 874 |
| 875 RecordAppLaunchForTab(browser, tab, selected_index); | 875 RecordAppLaunchForTab(browser, tab, selected_index); |
| 876 | 876 |
| 877 // Associate sessionStorage (if any) to the restored tab. | 877 // Associate sessionStorage (if any) to the restored tab. |
| 878 scoped_refptr<content::SessionStorageNamespace> session_storage_namespace; | 878 scoped_refptr<content::SessionStorageNamespace> session_storage_namespace; |
| 879 if (!tab.session_storage_persistent_id.empty()) { | 879 if (!tab.session_storage_persistent_id.empty()) { |
| 880 session_storage_namespace = | 880 session_storage_namespace = |
| 881 content::BrowserContext::GetDOMStorageContext(profile_)-> | 881 content::BrowserContext::GetDefaultDOMStorageContext(profile_)-> |
| 882 RecreateSessionStorage(tab.session_storage_persistent_id); | 882 RecreateSessionStorage(tab.session_storage_persistent_id); |
| 883 } | 883 } |
| 884 | 884 |
| 885 WebContents* web_contents = | 885 WebContents* web_contents = |
| 886 chrome::AddRestoredTab(browser, | 886 chrome::AddRestoredTab(browser, |
| 887 tab.navigations, | 887 tab.navigations, |
| 888 tab_index, | 888 tab_index, |
| 889 selected_index, | 889 selected_index, |
| 890 tab.extension_app_id, | 890 tab.extension_app_id, |
| 891 false, // select | 891 false, // select |
| (...skipping 197 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 |