aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-03-31 09:33:19 +0800
committerkumavis <aaron@kumavis.me>2017-03-31 09:33:19 +0800
commit5036263f88a1f61957982b64d27472a516c28def (patch)
tree1aa3ea47b8dc9032e165ee988da38279252729ce /app/scripts/metamask-controller.js
parentbe88c87b2560f0ae2afd668d9c10cadde0a4ebc3 (diff)
downloadtangerine-wallet-browser-5036263f88a1f61957982b64d27472a516c28def.tar
tangerine-wallet-browser-5036263f88a1f61957982b64d27472a516c28def.tar.gz
tangerine-wallet-browser-5036263f88a1f61957982b64d27472a516c28def.tar.bz2
tangerine-wallet-browser-5036263f88a1f61957982b64d27472a516c28def.tar.lz
tangerine-wallet-browser-5036263f88a1f61957982b64d27472a516c28def.tar.xz
tangerine-wallet-browser-5036263f88a1f61957982b64d27472a516c28def.tar.zst
tangerine-wallet-browser-5036263f88a1f61957982b64d27472a516c28def.zip
introduce platform api and rename notifications to notification-manager
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r--app/scripts/metamask-controller.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 03ea104e0..af8b4688d 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -20,7 +20,6 @@ const MessageManager = require('./lib/message-manager')
const PersonalMessageManager = require('./lib/personal-message-manager')
const TxManager = require('./transaction-manager')
const ConfigManager = require('./lib/config-manager')
-const extension = require('./lib/extension')
const autoFaucet = require('./lib/auto-faucet')
const nodeify = require('./lib/nodeify')
const accountImporter = require('./account-import-strategies')
@@ -34,6 +33,9 @@ module.exports = class MetamaskController extends EventEmitter {
this.opts = opts
let initState = opts.initState || {}
+ // platform-specific api
+ this.platform = opts.platform
+
// observable state store
this.store = new ObservableStore(initState)
@@ -629,7 +631,7 @@ module.exports = class MetamaskController extends EventEmitter {
break
}
- if (url) extension.tabs.create({ url })
+ if (url) this.platform.openWindow({ url })
}
createShapeShiftTx (depositAddress, depositType) {
@@ -647,7 +649,7 @@ module.exports = class MetamaskController extends EventEmitter {
setDefaultRpc () {
this.configManager.setRpcTarget('http://localhost:8545')
- extension.runtime.reload()
+ this.platform.reload()
this.lookupNetwork()
return Promise.resolve('http://localhost:8545')
}
@@ -656,7 +658,7 @@ module.exports = class MetamaskController extends EventEmitter {
this.configManager.setRpcTarget(rpcTarget)
return this.preferencesController.updateFrequentRpcList(rpcTarget)
.then(() => {
- extension.runtime.reload()
+ this.platform.reload()
this.lookupNetwork()
return Promise.resolve(rpcTarget)
})
@@ -664,13 +666,13 @@ module.exports = class MetamaskController extends EventEmitter {
setProviderType (type) {
this.configManager.setProviderType(type)
- extension.runtime.reload()
+ this.platform.reload()
this.lookupNetwork()
}
useEtherscanProvider () {
this.configManager.useEtherscanProvider()
- extension.runtime.reload()
+ this.platform.reload()
}
getNetworkState () {