Chromium Code Reviews| Index: extensions/renderer/resources/binding.js |
| diff --git a/extensions/renderer/resources/binding.js b/extensions/renderer/resources/binding.js |
| index d0b7e61b5e587c70d03056fce6cd79a72bfa13b6..920345526fdf2cf18bcca46d53691c504c1c9b68 100644 |
| --- a/extensions/renderer/resources/binding.js |
| +++ b/extensions/renderer/resources/binding.js |
| @@ -20,6 +20,7 @@ var sendRequestHandler = require('sendRequest'); |
| var contextType = process.GetContextType(); |
| var extensionId = process.GetExtensionId(); |
| var manifestVersion = process.GetManifestVersion(); |
| +var platform = process.GetPlatform(); |
| var sendRequest = sendRequestHandler.sendRequest; |
| // Stores the name and definition of each API function, with methods to |
| @@ -87,24 +88,6 @@ APIFunctions.prototype.setCustomCallback = |
| return this.setHook_(apiName, 'customCallback', customizedFunction); |
| }; |
| -// Get the platform from navigator.appVersion. |
| -function getPlatform() { |
| - var platforms = [ |
| - [/CrOS Touch/, "chromeos touch"], |
|
lazyboy
2017/07/07 23:09:26
You're also removing "chromeos touch", which is un
Devlin
2017/07/10 18:35:31
Good idea; done.
|
| - [/CrOS/, "chromeos"], |
| - [/Linux/, "linux"], |
| - [/Mac/, "mac"], |
| - [/Win/, "win"], |
| - ]; |
| - |
| - for (var i = 0; i < platforms.length; i++) { |
| - if ($RegExp.exec(platforms[i][0], navigator.appVersion)) { |
| - return platforms[i][1]; |
| - } |
| - } |
| - return "unknown"; |
| -} |
| - |
| function isPlatformSupported(schemaNode, platform) { |
| return !schemaNode.platforms || |
| $Array.indexOf(schemaNode.platforms, platform) > -1; |
| @@ -145,8 +128,6 @@ function createCustomType(type) { |
| return customType; |
| } |
| -var platform = getPlatform(); |
| - |
| function Binding(apiName) { |
| this.apiName_ = apiName; |
| this.apiFunctions_ = new APIFunctions(apiName); |