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

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

Issue 11724002: Move ContentScripts out of Extension (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: Latest master for CQ Created 7 years, 9 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/content_scripts_parser.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) 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/chromeos/accessibility/accessibility_util.h" 5 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
6 6
7 #include <queue> 7 #include <queue>
8 8
9 #include "ash/high_contrast/high_contrast_controller.h" 9 #include "ash/high_contrast/high_contrast_controller.h"
10 #include "ash/magnifier/magnification_controller.h" 10 #include "ash/magnifier/magnification_controller.h"
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" 21 #include "chrome/browser/chromeos/accessibility/magnification_manager.h"
22 #include "chrome/browser/extensions/component_loader.h" 22 #include "chrome/browser/extensions/component_loader.h"
23 #include "chrome/browser/extensions/extension_service.h" 23 #include "chrome/browser/extensions/extension_service.h"
24 #include "chrome/browser/extensions/extension_system.h" 24 #include "chrome/browser/extensions/extension_system.h"
25 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
26 #include "chrome/browser/profiles/profile_manager.h" 26 #include "chrome/browser/profiles/profile_manager.h"
27 #include "chrome/browser/speech/tts_controller.h" 27 #include "chrome/browser/speech/tts_controller.h"
28 #include "chrome/browser/ui/singleton_tabs.h" 28 #include "chrome/browser/ui/singleton_tabs.h"
29 #include "chrome/common/extensions/extension.h" 29 #include "chrome/common/extensions/extension.h"
30 #include "chrome/common/extensions/extension_messages.h" 30 #include "chrome/common/extensions/extension_messages.h"
31 #include "chrome/common/extensions/manifest_handlers/content_scripts_handler.h"
31 #include "chrome/common/extensions/user_script.h" 32 #include "chrome/common/extensions/user_script.h"
32 #include "chrome/common/pref_names.h" 33 #include "chrome/common/pref_names.h"
33 #include "chrome/common/url_constants.h" 34 #include "chrome/common/url_constants.h"
34 #include "content/public/browser/browser_accessibility_state.h" 35 #include "content/public/browser/browser_accessibility_state.h"
35 #include "content/public/browser/notification_service.h" 36 #include "content/public/browser/notification_service.h"
36 #include "content/public/browser/render_process_host.h" 37 #include "content/public/browser/render_process_host.h"
37 #include "content/public/browser/render_view_host.h" 38 #include "content/public/browser/render_view_host.h"
38 #include "content/public/browser/web_contents.h" 39 #include "content/public/browser/web_contents.h"
39 #include "content/public/browser/web_ui.h" 40 #include "content/public/browser/web_ui.h"
40 #include "extensions/browser/file_reader.h" 41 #include "extensions/browser/file_reader.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 params.all_frames = true; 191 params.all_frames = true;
191 params.in_main_world = false; 192 params.in_main_world = false;
192 render_view_host->Send(new ExtensionMsg_ExecuteCode( 193 render_view_host->Send(new ExtensionMsg_ExecuteCode(
193 render_view_host->GetRoutingID(), params)); 194 render_view_host->GetRoutingID(), params));
194 195
195 // Inject ChromeVox' content scripts. 196 // Inject ChromeVox' content scripts.
196 ContentScriptLoader* loader = new ContentScriptLoader( 197 ContentScriptLoader* loader = new ContentScriptLoader(
197 extension->id(), render_view_host->GetProcess()->GetID(), 198 extension->id(), render_view_host->GetProcess()->GetID(),
198 render_view_host->GetRoutingID()); 199 render_view_host->GetRoutingID());
199 200
200 for (size_t i = 0; i < extension->content_scripts().size(); i++) { 201 const extensions::UserScriptList& content_scripts =
201 const extensions::UserScript& script = extension->content_scripts()[i]; 202 extensions::ContentScriptsInfo::GetContentScripts(extension);
203 for (size_t i = 0; i < content_scripts.size(); i++) {
204 const extensions::UserScript& script = content_scripts[i];
202 for (size_t j = 0; j < script.js_scripts().size(); ++j) { 205 for (size_t j = 0; j < script.js_scripts().size(); ++j) {
203 const extensions::UserScript::File &file = script.js_scripts()[j]; 206 const extensions::UserScript::File &file = script.js_scripts()[j];
204 extensions::ExtensionResource resource = extension->GetResource( 207 extensions::ExtensionResource resource = extension->GetResource(
205 file.relative_path()); 208 file.relative_path());
206 loader->AppendScript(resource); 209 loader->AppendScript(resource);
207 } 210 }
208 } 211 }
209 loader->Run(); // It cleans itself up when done. 212 loader->Run(); // It cleans itself up when done.
210 } 213 }
211 214
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 if (IsSpokenFeedbackEnabled()) 299 if (IsSpokenFeedbackEnabled())
297 Speak(utterance); 300 Speak(utterance);
298 } 301 }
299 302
300 void ShowAccessibilityHelp(Browser* browser) { 303 void ShowAccessibilityHelp(Browser* browser) {
301 chrome::ShowSingletonTab(browser, GURL(chrome::kChromeAccessibilityHelpURL)); 304 chrome::ShowSingletonTab(browser, GURL(chrome::kChromeAccessibilityHelpURL));
302 } 305 }
303 306
304 } // namespace accessibility 307 } // namespace accessibility
305 } // namespace chromeos 308 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/content_scripts_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698