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

Unified Diff: chrome/browser/resources/access_chromevox/chromevox/injected/main.js

Issue 6254007: Adding ChromeVox as a component extensions (enabled only for ChromeOS, for no... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
Index: chrome/browser/resources/access_chromevox/chromevox/injected/main.js
===================================================================
--- chrome/browser/resources/access_chromevox/chromevox/injected/main.js (revision 0)
+++ chrome/browser/resources/access_chromevox/chromevox/injected/main.js (revision 0)
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 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.
+
+/**
+ * @fileoverview The main entry point for the extension content script.
+ *
+ * This is the only file that has access to the chrome.extension API
+ * from the content script, because all other scripts are loaded into the
+ * document head. So, any use of these extension APIs must be done in this
+ * file.
+ */
+
+// TODO(dmazzoni): pull in these dependencies without explicitly
+// calling the private method writeScriptTag_.
+function initialize() {
+ if (COMPILED) {
+ var loadCompiledScript = function(scriptRelPath) {
+ var scriptElt = document.createElement('script');
+ scriptElt.type = 'text/javascript';
+ scriptElt.src = chrome.extension.getURL(scriptRelPath);
+ document.getElementsByTagName('head')[0].appendChild(scriptElt);
+ };
+ if (BUILD_TYPE == BUILD_TYPE_CHROME) {
+ loadCompiledScript('/chromeVoxChromePageScript.js');
+ } else if (BUILD_TYPE == BUILD_TYPE_ANDROID_DEV) {
+ loadCompiledScript('/androidVoxDev.js');
+ } else {
+ throw 'Unknown or unsupported build type: ' + BUILD_TYPE;
+ }
+ } else {
+ goog.writeScriptTag_(chrome.extension.getURL('/closure/base.js'));
+ goog.writeScriptTag_(chrome.extension.getURL('../powerkey-bundle.js'));
+ goog.require('cvox.ChromeVoxInit');
+ }
+}
+
+initialize();
Property changes on: chrome/browser/resources/access_chromevox/chromevox/injected/main.js
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698