Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: chrome/browser/resources/md_extensions/detail_view.js

Issue 2329443004: [MD Extensions] Implement opening tab-style options pages (Closed)
Patch Set: Michael's Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 delegate: Object, 21 delegate: Object,
22 }, 22 },
23 23
24 ready: function() { 24 ready: function() {
25 this.sharedElements = {hero: this.$.main}; 25 this.sharedElements = {hero: this.$.main};
26 /** @type {!extensions.AnimationHelper} */ 26 /** @type {!extensions.AnimationHelper} */
27 this.animationHelper = new extensions.AnimationHelper(this, this.$.main); 27 this.animationHelper = new extensions.AnimationHelper(this, this.$.main);
28 }, 28 },
29 29
30 /** @private */ 30 /** @private */
31 onCloseButtonClick_: function() { 31 onCloseButtonTap_: function() {
32 this.fire('close'); 32 this.fire('close');
33 }, 33 },
34 34
35 /** 35 /**
36 * @return {boolean} 36 * @return {boolean}
37 * @private 37 * @private
38 */ 38 */
39 hasDependentExtensions_: function() { 39 hasDependentExtensions_: function() {
40 return this.data.dependentExtensions.length > 0; 40 return this.data.dependentExtensions.length > 0;
41 }, 41 },
42 42
43 /** 43 /**
44 * @return {boolean} 44 * @return {boolean}
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 onOptionsButtonTap_: 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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_extensions/detail_view.html ('k') | chrome/browser/resources/md_extensions/item.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698