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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 base::PLATFORM_FILE_ASYNC; | 905 base::PLATFORM_FILE_ASYNC; |
906 const std::string& state = | 906 const std::string& state = |
907 tab.navigations.at(selected_index).state(); | 907 tab.navigations.at(selected_index).state(); |
908 const std::vector<FilePath>& file_paths = | 908 const std::vector<FilePath>& file_paths = |
909 webkit_glue::FilePathsFromHistoryState(state); | 909 webkit_glue::FilePathsFromHistoryState(state); |
910 for (std::vector<FilePath>::const_iterator file = file_paths.begin(); | 910 for (std::vector<FilePath>::const_iterator file = file_paths.begin(); |
911 file != file_paths.end(); ++file) { | 911 file != file_paths.end(); ++file) { |
912 content::ChildProcessSecurityPolicy::GetInstance()-> | 912 content::ChildProcessSecurityPolicy::GetInstance()-> |
913 GrantPermissionsForFile(id, *file, read_file_permissions); | 913 GrantPermissionsForFile(id, *file, read_file_permissions); |
914 } | 914 } |
| 915 // Set up file access rights for selected files in file inputs. |
| 916 const std::vector<FilePath>& input_file_paths = |
| 917 webkit_glue::FilePathsFromInputsInHistoryState(state); |
| 918 for (std::vector<FilePath>::const_iterator file = input_file_paths.begin(); |
| 919 file != input_file_paths.end(); ++file) { |
| 920 content::ChildProcessSecurityPolicy::GetInstance()-> |
| 921 GrantPermissionsForFile(id, *file, read_file_permissions); |
| 922 } |
915 | 923 |
916 if (schedule_load) | 924 if (schedule_load) |
917 tab_loader_->ScheduleLoad(&web_contents->GetController()); | 925 tab_loader_->ScheduleLoad(&web_contents->GetController()); |
918 return web_contents; | 926 return web_contents; |
919 } | 927 } |
920 | 928 |
921 Browser* CreateRestoredBrowser(Browser::Type type, | 929 Browser* CreateRestoredBrowser(Browser::Type type, |
922 gfx::Rect bounds, | 930 gfx::Rect bounds, |
923 ui::WindowShowState show_state, | 931 ui::WindowShowState show_state, |
924 const std::string& app_name) { | 932 const std::string& app_name) { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 if (active_session_restorers == NULL) | 1097 if (active_session_restorers == NULL) |
1090 return false; | 1098 return false; |
1091 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1099 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1092 active_session_restorers->begin(); | 1100 active_session_restorers->begin(); |
1093 it != active_session_restorers->end(); ++it) { | 1101 it != active_session_restorers->end(); ++it) { |
1094 if ((*it)->profile() == profile) | 1102 if ((*it)->profile() == profile) |
1095 return true; | 1103 return true; |
1096 } | 1104 } |
1097 return false; | 1105 return false; |
1098 } | 1106 } |
OLD | NEW |