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

Unified Diff: ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js

Issue 246543002: Add script files of the separated Gallery.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. 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 side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js b/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
index b86fb357d3e1197dcd57e10a4cc1ebc023302d27..a9ee9a4cbb8c368fdc9529a5334613967ec6bb22 100644
--- a/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
+++ b/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
@@ -874,16 +874,11 @@ function ContentProvider() {
// Pass all URLs to the metadata reader until we have a correct filter.
this.urlFilter_ = /.*/;
- var path = document.location.pathname;
- var workerPath = document.location.origin +
- path.substring(0, path.lastIndexOf('/') + 1) +
- 'foreground/js/metadata/metadata_dispatcher.js';
-
- this.dispatcher_ = new SharedWorker(workerPath).port;
- this.dispatcher_.start();
-
- this.dispatcher_.onmessage = this.onMessage_.bind(this);
- this.dispatcher_.postMessage({verb: 'init'});
+ var dispatcher = new SharedWorker(ContentProvider.WORKER_SCRIPT).port;
+ dispatcher.onmessage = this.onMessage_.bind(this);
+ dispatcher.postMessage({verb: 'init'});
+ dispatcher.start();
+ this.dispatcher_ = dispatcher;
// Initialization is not complete until the Worker sends back the
// 'initialized' message. See below.
@@ -894,6 +889,15 @@ function ContentProvider() {
this.callbacks_ = {};
}
+/**
+ * Path of a worker script.
+ * @type {string}
+ * @const
+ */
+ContentProvider.WORKER_SCRIPT =
+ 'chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/' +
+ 'foreground/js/metadata/metadata_dispatcher.js';
+
ContentProvider.prototype = {
__proto__: MetadataProvider.prototype
};

Powered by Google App Engine
This is Rietveld 408576698