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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // Keep a separate list of extensions for which to disable file access, since | 182 // Keep a separate list of extensions for which to disable file access, since |
183 // doing so reloads them. | 183 // doing so reloads them. |
184 std::vector<const extensions::Extension*> extension_list; | 184 std::vector<const extensions::Extension*> extension_list; |
185 | 185 |
186 ExtensionService* service = extensions::ExtensionSystem::Get( | 186 ExtensionService* service = extensions::ExtensionSystem::Get( |
187 browser()->profile())->extension_service(); | 187 browser()->profile())->extension_service(); |
188 for (ExtensionSet::const_iterator it = service->extensions()->begin(); | 188 for (ExtensionSet::const_iterator it = service->extensions()->begin(); |
189 it != service->extensions()->end(); ++it) { | 189 it != service->extensions()->end(); ++it) { |
190 if ((*it)->location() == extensions::Manifest::COMPONENT) | 190 if ((*it)->location() == extensions::Manifest::COMPONENT) |
191 continue; | 191 continue; |
192 if (service->AllowFileAccess(*it)) | 192 if (service->AllowFileAccess(it->get())) |
193 extension_list.push_back(*it); | 193 extension_list.push_back(it->get()); |
194 } | 194 } |
195 | 195 |
196 for (size_t i = 0; i < extension_list.size(); ++i) { | 196 for (size_t i = 0; i < extension_list.size(); ++i) { |
197 content::WindowedNotificationObserver user_scripts_observer( | 197 content::WindowedNotificationObserver user_scripts_observer( |
198 chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, | 198 chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, |
199 content::NotificationService::AllSources()); | 199 content::NotificationService::AllSources()); |
200 service->SetAllowFileAccess(extension_list[i], false); | 200 service->SetAllowFileAccess(extension_list[i], false); |
201 user_scripts_observer.Wait(); | 201 user_scripts_observer.Wait(); |
202 } | 202 } |
203 | 203 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 .AppendASCII("extensions") | 269 .AppendASCII("extensions") |
270 .AppendASCII("app2"); | 270 .AppendASCII("app2"); |
271 load_extensions_.push_back(fourth_extension_path.value()); | 271 load_extensions_.push_back(fourth_extension_path.value()); |
272 } | 272 } |
273 }; | 273 }; |
274 | 274 |
275 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { | 275 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { |
276 WaitForServicesToStart(4, true); | 276 WaitForServicesToStart(4, true); |
277 TestInjection(true, true); | 277 TestInjection(true, true); |
278 } | 278 } |
OLD | NEW |