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

Unified Diff: chrome/browser/resources/access_chromevox/chromevox/background/bookmark_manager.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/background/bookmark_manager.js
===================================================================
--- chrome/browser/resources/access_chromevox/chromevox/background/bookmark_manager.js (revision 0)
+++ chrome/browser/resources/access_chromevox/chromevox/background/bookmark_manager.js (revision 0)
@@ -0,0 +1,52 @@
+// 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.
+
+var COMPILED_FLAG = false;
+var TEST_FLAG = false;
+var BASE_URL = '';
+
+/**
+ * Loads the bookmark manager.
+ */
+function loadBookmarkManager() {
+ if (document.location.toString().indexOf(
+ 'http://www.corp.google.com/~chaitanyag/speech/flash.html') == 0) {
+ return;
+ }
+
+ // Use a hidden div to send messages from the injected content script
+ // to the extension background page.
+ var port = chrome.extension.connect({name: 'content2Chrome'});
+ var hiddenDiv = document.createElement('div');
+ hiddenDiv.id = 'cvoxPage2ExtensionDiv';
+ hiddenDiv.style.display = 'none';
+ document.body.appendChild(hiddenDiv);
+ document.addEventListener('cvoxPage2ExtensionEvent', function() {
+ var message = JSON.parse(hiddenDiv.innerHTML);
+ port.postMessage(message);
+ });
+
+ // Append this to the end of a remote URL to force it to bypass the cache
+ // and be redownloaded.
+ var forceRedownload = '?' + new Date().getTime();
+
+ function loadScript(src) {
+ var theScript = document.createElement('script');
+ theScript.type = 'text/javascript';
+ if (src.substr(0, 4) == 'http')
+ theScript.src = src + forceRedownload;
+ else if (BASE_URL)
+ theScript.src = BASE_URL + src + forceRedownload;
+ else
+ theScript.src = chrome.extension.getURL(src) + forceRedownload;
+ document.getElementsByTagName('head')[0].appendChild(theScript);
+ }
+
+ loadScript('chromevox/injected/extension_bridge.js');
+ loadScript('browser/chromeVox_ttsBridge.js');
+ loadScript('tts/chromeVox_earcons.js');
+ loadScript('chromevox/background/bookmark_manager_ui.js');
+}
+
+loadBookmarkManager();
Property changes on: chrome/browser/resources/access_chromevox/chromevox/background/bookmark_manager.js
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698