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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1037 GetDOMStorageContext()->RecreateSessionStorage( | 1037 GetDOMStorageContext()->RecreateSessionStorage( |
1038 tab.session_storage_persistent_id); | 1038 tab.session_storage_persistent_id); |
1039 } | 1039 } |
1040 | 1040 |
1041 WebContents* web_contents = | 1041 WebContents* web_contents = |
1042 chrome::AddRestoredTab(browser, | 1042 chrome::AddRestoredTab(browser, |
1043 tab.navigations, | 1043 tab.navigations, |
1044 tab_index, | 1044 tab_index, |
1045 selected_index, | 1045 selected_index, |
1046 tab.extension_app_id, | 1046 tab.extension_app_id, |
1047 false, // select | 1047 !schedule_load, // select |
oshima
2014/07/17 22:22:21
this value is computed from selected_tab_index her
sky
2014/07/18 15:42:10
I think selected would be clearer here as well as
| |
1048 tab.pinned, | 1048 tab.pinned, |
1049 true, | 1049 true, |
1050 session_storage_namespace.get(), | 1050 session_storage_namespace.get(), |
1051 tab.user_agent_override); | 1051 tab.user_agent_override); |
1052 // Regression check: check that the tab didn't start loading right away. The | 1052 // Regression check: check that the tab didn't start loading right away. The |
1053 // focused tab will be loaded by Browser, and TabLoader will load the rest. | 1053 // focused tab will be loaded by Browser, and TabLoader will load the rest. |
1054 DCHECK(web_contents->GetController().NeedsReload()); | 1054 DCHECK(!schedule_load || web_contents->GetController().NeedsReload()); |
1055 | 1055 |
1056 // Set up the file access rights for the selected navigation entry. | 1056 // Set up the file access rights for the selected navigation entry. |
1057 const int id = web_contents->GetRenderProcessHost()->GetID(); | 1057 const int id = web_contents->GetRenderProcessHost()->GetID(); |
1058 const content::PageState& page_state = | 1058 const content::PageState& page_state = |
1059 tab.navigations.at(selected_index).page_state(); | 1059 tab.navigations.at(selected_index).page_state(); |
1060 const std::vector<base::FilePath>& file_paths = | 1060 const std::vector<base::FilePath>& file_paths = |
1061 page_state.GetReferencedFiles(); | 1061 page_state.GetReferencedFiles(); |
1062 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); | 1062 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); |
1063 file != file_paths.end(); ++file) { | 1063 file != file_paths.end(); ++file) { |
1064 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id, | 1064 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id, |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1292 if (!active_session_restorers) | 1292 if (!active_session_restorers) |
1293 return false; | 1293 return false; |
1294 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1294 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1295 active_session_restorers->begin(); | 1295 active_session_restorers->begin(); |
1296 it != active_session_restorers->end(); ++it) { | 1296 it != active_session_restorers->end(); ++it) { |
1297 if ((*it)->synchronous()) | 1297 if ((*it)->synchronous()) |
1298 return true; | 1298 return true; |
1299 } | 1299 } |
1300 return false; | 1300 return false; |
1301 } | 1301 } |
OLD | NEW |