diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /services/cloudsync/CloudSync.jsm | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'services/cloudsync/CloudSync.jsm')
-rw-r--r-- | services/cloudsync/CloudSync.jsm | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/services/cloudsync/CloudSync.jsm b/services/cloudsync/CloudSync.jsm new file mode 100644 index 000000000..2c1057ea9 --- /dev/null +++ b/services/cloudsync/CloudSync.jsm @@ -0,0 +1,89 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +this.EXPORTED_SYMBOLS = ["CloudSync"]; + +Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); + +XPCOMUtils.defineLazyModuleGetter(this, "Adapters", + "resource://gre/modules/CloudSyncAdapters.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Local", + "resource://gre/modules/CloudSyncLocal.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Bookmarks", + "resource://gre/modules/CloudSyncBookmarks.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Tabs", + "resource://gre/modules/CloudSyncTabs.jsm"); + +var API_VERSION = 1; + +var _CloudSync = function () { +}; + +_CloudSync.prototype = { + _adapters: null, + + get adapters () { + if (!this._adapters) { + this._adapters = new Adapters(); + } + return this._adapters; + }, + + _bookmarks: null, + + get bookmarks () { + if (!this._bookmarks) { + this._bookmarks = new Bookmarks(); + } + return this._bookmarks; + }, + + _local: null, + + get local () { + if (!this._local) { + this._local = new Local(); + } + return this._local; + }, + + _tabs: null, + + get tabs () { + if (!this._tabs) { + this._tabs = new Tabs(); + } + return this._tabs; + }, + + get tabsReady () { + return this._tabs ? true: false; + }, + + get version () { + return API_VERSION; + }, +}; + +this.CloudSync = function CloudSync () { + return _cloudSyncInternal.instance; +}; + +Object.defineProperty(CloudSync, "ready", { + get: function () { + return _cloudSyncInternal.ready; + } +}); + +var _cloudSyncInternal = { + instance: null, + ready: false, +}; + +XPCOMUtils.defineLazyGetter(_cloudSyncInternal, "instance", function () { + _cloudSyncInternal.ready = true; + return new _CloudSync(); +}.bind(this)); |