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

Unified Diff: ui/accessibility/extensions/alt/background.js

Issue 593293002: Initial checkin of accessibility extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix license issues Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/accessibility/extensions/README.chromium ('k') | ui/accessibility/extensions/alt/hide-images.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/extensions/alt/background.js
diff --git a/ui/accessibility/extensions/alt/background.js b/ui/accessibility/extensions/alt/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..a37bd83c64a68f2898afce76449d97511aafc224
--- /dev/null
+++ b/ui/accessibility/extensions/alt/background.js
@@ -0,0 +1,45 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function injectScripts(opt_tab) {
+ chrome.tabs.executeScript({
+ file: 'lib/axs_testing.js',
+ allFrames: true
+ }, function() {
+ console.log('successfully injected axs_testing.js');
+ chrome.tabs.executeScript({
+ file: 'hide-images.js',
+ allFrames: true
+ }, function() {
+ console.log('successfully injected script', opt_tab ? opt_tab.url : '');
+ chrome.tabs.insertCSS({
+ file: 'hide-images.css',
+ allFrames: true
+ }, function() {
+ console.log('successfully injected css', opt_tab ? opt_tab.url : '');
+ chrome.tabs.executeScript({
+ code: 'toggleEnabled();',
+ allFrames: true
+ }, function() {
+ console.log('created infobar');
+ chrome.tabs.executeScript({
+ code: 'createInfobar();'
+ });
+ });
+ });
+ });
+ });
+}
+
+chrome.commands.onCommand.addListener(function(command) {
+ console.log('command: ', command);
+ if (command == 'example_keyboard_command') {
+ injectScripts();
+ }
+});
+
+chrome.browserAction.onClicked.addListener(function(tab) {
+ injectScripts(tab);
+});
+
« no previous file with comments | « ui/accessibility/extensions/README.chromium ('k') | ui/accessibility/extensions/alt/hide-images.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698