OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('extensions', function() { | 5 cr.define('extensions', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 var MAX_HEIGHT = 600; | 8 var MAX_HEIGHT = 600; |
9 var MAX_WIDTH = 600; | 9 var MAX_WIDTH = 600; |
10 var MIN_HEIGHT = 300; | 10 var MIN_HEIGHT = 300; |
11 var MIN_WIDTH = 300; | 11 var MIN_WIDTH = 300; |
12 var HEADER_PADDING = 40; | 12 var HEADER_PADDING = 40; |
13 | 13 |
14 var OptionsDialog = Polymer({ | 14 var OptionsDialog = Polymer({ |
15 is: 'extensions-options-dialog', | 15 is: 'extensions-options-dialog', |
16 properties: { | 16 properties: { |
17 /** @private {Object} */ | 17 /** @private {Object} */ |
18 extensionOptions_: Object, | 18 extensionOptions_: Object, |
19 | 19 |
20 /** @private {chrome.developerPrivate.ExtensionInfo} */ | 20 /** @private {chrome.developerPrivate.ExtensionInfo} */ |
21 data_: Object, | 21 data_: Object, |
22 }, | 22 }, |
23 | 23 |
| 24 get open() { |
| 25 return this.$$('dialog').open; |
| 26 }, |
| 27 |
24 /** @param {chrome.developerPrivate.ExtensionInfo} data */ | 28 /** @param {chrome.developerPrivate.ExtensionInfo} data */ |
25 show: function(data) { | 29 show: function(data) { |
26 this.data_ = data; | 30 this.data_ = data; |
27 if (!this.extensionOptions_) | 31 if (!this.extensionOptions_) |
28 this.extensionOptions_ = document.createElement('ExtensionOptions'); | 32 this.extensionOptions_ = document.createElement('ExtensionOptions'); |
29 this.extensionOptions_.extension = this.data_.id; | 33 this.extensionOptions_.extension = this.data_.id; |
30 this.extensionOptions_.onclose = this.close.bind(this); | 34 this.extensionOptions_.onclose = this.close.bind(this); |
31 var bounded = function(min, max, val) { | 35 var bounded = function(min, max, val) { |
32 return Math.min(Math.max(min, val), max); | 36 return Math.min(Math.max(min, val), max); |
33 }; | 37 }; |
(...skipping 16 matching lines...) Expand all Loading... |
50 onSizeChanged({height: 0, width: 0}); | 54 onSizeChanged({height: 0, width: 0}); |
51 }, | 55 }, |
52 | 56 |
53 close: function() { | 57 close: function() { |
54 this.$$('dialog').close(); | 58 this.$$('dialog').close(); |
55 }, | 59 }, |
56 }); | 60 }); |
57 | 61 |
58 return {OptionsDialog: OptionsDialog}; | 62 return {OptionsDialog: OptionsDialog}; |
59 }); | 63 }); |
OLD | NEW |