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

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

Issue 226663003: Allow content script insertion on about:-URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use matches_about_blank key instead of about:* permission. Created 6 years, 8 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
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 "ash/audio/sounds.h" 7 #include "ash/audio/sounds.h"
8 #include "ash/autoclick/autoclick_controller.h" 8 #include "ash/autoclick/autoclick_controller.h"
9 #include "ash/high_contrast/high_contrast_controller.h" 9 #include "ash/high_contrast/high_contrast_controller.h"
10 #include "ash/metrics/user_metrics_recorder.h" 10 #include "ash/metrics/user_metrics_recorder.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 private: 126 private:
127 void OnFileLoaded(bool success, const std::string& data) { 127 void OnFileLoaded(bool success, const std::string& data) {
128 if (success) { 128 if (success) {
129 ExtensionMsg_ExecuteCode_Params params; 129 ExtensionMsg_ExecuteCode_Params params;
130 params.request_id = 0; 130 params.request_id = 0;
131 params.extension_id = extension_id_; 131 params.extension_id = extension_id_;
132 params.is_javascript = true; 132 params.is_javascript = true;
133 params.code = data; 133 params.code = data;
134 params.run_at = extensions::UserScript::DOCUMENT_IDLE; 134 params.run_at = extensions::UserScript::DOCUMENT_IDLE;
135 params.all_frames = true; 135 params.all_frames = true;
136 params.match_about_blank = false;
136 params.in_main_world = false; 137 params.in_main_world = false;
137 138
138 RenderViewHost* render_view_host = 139 RenderViewHost* render_view_host =
139 RenderViewHost::FromID(render_process_id_, render_view_id_); 140 RenderViewHost::FromID(render_process_id_, render_view_id_);
140 if (render_view_host) { 141 if (render_view_host) {
141 render_view_host->Send(new ExtensionMsg_ExecuteCode( 142 render_view_host->Send(new ExtensionMsg_ExecuteCode(
142 render_view_host->GetRoutingID(), params)); 143 render_view_host->GetRoutingID(), params));
143 } 144 }
144 } 145 }
145 Run(); 146 Run();
(...skipping 19 matching lines...) Expand all
165 166
166 // Set a flag to tell ChromeVox that it's just been enabled, 167 // Set a flag to tell ChromeVox that it's just been enabled,
167 // so that it won't interrupt our speech feedback enabled message. 168 // so that it won't interrupt our speech feedback enabled message.
168 ExtensionMsg_ExecuteCode_Params params; 169 ExtensionMsg_ExecuteCode_Params params;
169 params.request_id = 0; 170 params.request_id = 0;
170 params.extension_id = extension->id(); 171 params.extension_id = extension->id();
171 params.is_javascript = true; 172 params.is_javascript = true;
172 params.code = "window.INJECTED_AFTER_LOAD = true;"; 173 params.code = "window.INJECTED_AFTER_LOAD = true;";
173 params.run_at = extensions::UserScript::DOCUMENT_IDLE; 174 params.run_at = extensions::UserScript::DOCUMENT_IDLE;
174 params.all_frames = true; 175 params.all_frames = true;
176 params.match_about_blank = false;
175 params.in_main_world = false; 177 params.in_main_world = false;
176 render_view_host->Send(new ExtensionMsg_ExecuteCode( 178 render_view_host->Send(new ExtensionMsg_ExecuteCode(
177 render_view_host->GetRoutingID(), params)); 179 render_view_host->GetRoutingID(), params));
178 180
179 // Inject ChromeVox' content scripts. 181 // Inject ChromeVox' content scripts.
180 ContentScriptLoader* loader = new ContentScriptLoader( 182 ContentScriptLoader* loader = new ContentScriptLoader(
181 extension->id(), render_view_host->GetProcess()->GetID(), 183 extension->id(), render_view_host->GetProcess()->GetID(),
182 render_view_host->GetRoutingID()); 184 render_view_host->GetRoutingID());
183 185
184 const extensions::UserScriptList& content_scripts = 186 const extensions::UserScriptList& content_scripts =
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 chrome_vox_loaded_on_lock_screen_; 1014 chrome_vox_loaded_on_lock_screen_;
1013 } 1015 }
1014 1016
1015 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { 1017 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) {
1016 // Do any teardown work needed immediately after ChromeVox actually unloads. 1018 // Do any teardown work needed immediately after ChromeVox actually unloads.
1017 if (system_sounds_enabled_) 1019 if (system_sounds_enabled_)
1018 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); 1020 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED);
1019 } 1021 }
1020 1022
1021 } // namespace chromeos 1023 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/execute_code_function.cc » ('j') | chrome/browser/extensions/api/tabs/tabs_api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698