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 DetailView = Polymer({ | 8 var DetailView = Polymer({ |
9 is: 'extensions-detail-view', | 9 is: 'extensions-detail-view', |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 * @private | 45 * @private |
46 */ | 46 */ |
47 hasPermissions_: function() { | 47 hasPermissions_: function() { |
48 return this.data.permissions.length > 0; | 48 return this.data.permissions.length > 0; |
49 }, | 49 }, |
50 | 50 |
51 /** | 51 /** |
52 * @return {boolean} | 52 * @return {boolean} |
53 * @private | 53 * @private |
54 */ | 54 */ |
| 55 shouldShowOptionsButton_: function() { |
| 56 return !!this.data.optionsPage; |
| 57 }, |
| 58 |
| 59 /** |
| 60 * @return {boolean} |
| 61 * @private |
| 62 */ |
55 shouldShowOptionsSection_: function() { | 63 shouldShowOptionsSection_: function() { |
56 return this.data.incognitoAccess.isEnabled || | 64 return this.data.incognitoAccess.isEnabled || |
57 this.data.fileAccess.isEnabled || | 65 this.data.fileAccess.isEnabled || |
58 this.data.runOnAllUrls.isEnabled || | 66 this.data.runOnAllUrls.isEnabled || |
59 this.data.errorCollection.isEnabled; | 67 this.data.errorCollection.isEnabled; |
60 }, | 68 }, |
61 | 69 |
62 /** @private */ | 70 /** @private */ |
| 71 onOptionsButtonClick_: function() { |
| 72 this.delegate.showItemOptionsPage(this.data.id); |
| 73 }, |
| 74 |
| 75 /** @private */ |
63 onAllowIncognitoChange_: function() { | 76 onAllowIncognitoChange_: function() { |
64 this.delegate.setItemAllowedIncognito( | 77 this.delegate.setItemAllowedIncognito( |
65 this.data.id, this.$$('#allow-incognito').checked); | 78 this.data.id, this.$$('#allow-incognito').checked); |
66 }, | 79 }, |
67 | 80 |
68 /** @private */ | 81 /** @private */ |
69 onAllowOnFileUrlsChange_: function() { | 82 onAllowOnFileUrlsChange_: function() { |
70 this.delegate.setItemAllowedOnFileUrls( | 83 this.delegate.setItemAllowedOnFileUrls( |
71 this.data.id, this.$$('#allow-on-file-urls').checked); | 84 this.data.id, this.$$('#allow-on-file-urls').checked); |
72 }, | 85 }, |
(...skipping 20 matching lines...) Expand all Loading... |
93 | 106 |
94 /** @private */ | 107 /** @private */ |
95 computeSourceString_: function() { | 108 computeSourceString_: function() { |
96 return extensions.getItemSourceString( | 109 return extensions.getItemSourceString( |
97 extensions.getItemSource(this.data)); | 110 extensions.getItemSource(this.data)); |
98 } | 111 } |
99 }); | 112 }); |
100 | 113 |
101 return {DetailView: DetailView}; | 114 return {DetailView: DetailView}; |
102 }); | 115 }); |
OLD | NEW |