Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: chrome/browser/chromeos/accessibility/accessibility_manager.cc

Issue 2227193002: Make UserScript non-copyable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync @tott Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative_content/content_action.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/accessibility/accessibility_manager.h" 5 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 ExecuteScriptHelper(render_view_host, "window.INJECTED_AFTER_LOAD = true;", 258 ExecuteScriptHelper(render_view_host, "window.INJECTED_AFTER_LOAD = true;",
259 extension->id()); 259 extension->id());
260 260
261 // Inject ChromeVox' content scripts. 261 // Inject ChromeVox' content scripts.
262 ContentScriptLoader* loader = new ContentScriptLoader( 262 ContentScriptLoader* loader = new ContentScriptLoader(
263 extension->id(), render_view_host->GetProcess()->GetID(), 263 extension->id(), render_view_host->GetProcess()->GetID(),
264 render_view_host->GetRoutingID()); 264 render_view_host->GetRoutingID());
265 265
266 const extensions::UserScriptList& content_scripts = 266 const extensions::UserScriptList& content_scripts =
267 extensions::ContentScriptsInfo::GetContentScripts(extension); 267 extensions::ContentScriptsInfo::GetContentScripts(extension);
268 for (size_t i = 0; i < content_scripts.size(); i++) { 268 for (const std::unique_ptr<extensions::UserScript>& script :
269 const extensions::UserScript& script = content_scripts[i]; 269 content_scripts) {
270 if (web_contents && !script.MatchesURL(content_url)) 270 if (web_contents && !script->MatchesURL(content_url))
271 continue; 271 continue;
272 for (size_t j = 0; j < script.js_scripts().size(); ++j) { 272 for (const std::unique_ptr<extensions::UserScript::File>& file :
273 const extensions::UserScript::File& file = script.js_scripts()[j]; 273 script->js_scripts()) {
274 extensions::ExtensionResource resource = extension->GetResource( 274 extensions::ExtensionResource resource =
275 file.relative_path()); 275 extension->GetResource(file->relative_path());
276 loader->AppendScript(resource); 276 loader->AppendScript(resource);
277 } 277 }
278 } 278 }
279 loader->Run(); // It cleans itself up when done. 279 loader->Run(); // It cleans itself up when done.
280 } 280 }
281 281
282 void UnloadChromeVoxExtension(Profile* profile) { 282 void UnloadChromeVoxExtension(Profile* profile) {
283 base::FilePath path = GetChromeVoxPath(); 283 base::FilePath path = GetChromeVoxPath();
284 ExtensionService* extension_service = 284 ExtensionService* extension_service =
285 extensions::ExtensionSystem::Get(profile)->extension_service(); 285 extensions::ExtensionSystem::Get(profile)->extension_service();
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 content::BrowserContext* context) { 1543 content::BrowserContext* context) {
1544 keyboard_listener_extension_id_ = id; 1544 keyboard_listener_extension_id_ = id;
1545 1545
1546 extensions::ExtensionRegistry* registry = 1546 extensions::ExtensionRegistry* registry =
1547 extensions::ExtensionRegistry::Get(context); 1547 extensions::ExtensionRegistry::Get(context);
1548 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) 1548 if (!extension_registry_observer_.IsObserving(registry) && !id.empty())
1549 extension_registry_observer_.Add(registry); 1549 extension_registry_observer_.Add(registry);
1550 } 1550 }
1551 1551
1552 } // namespace chromeos 1552 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative_content/content_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698