OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * 'site-details' show the details (permissions and usage) for a given origin | 7 * 'site-details' show the details (permissions and usage) for a given origin |
8 * under Site Settings. | 8 * under Site Settings. |
9 */ | 9 */ |
10 Polymer({ | 10 Polymer({ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 /** | 47 /** |
48 * settings.RouteObserverBehavior | 48 * settings.RouteObserverBehavior |
49 * @param {!settings.Route} route | 49 * @param {!settings.Route} route |
50 * @protected | 50 * @protected |
51 */ | 51 */ |
52 currentRouteChanged: function(route) { | 52 currentRouteChanged: function(route) { |
53 var site = settings.getQueryParameters().get('site'); | 53 var site = settings.getQueryParameters().get('site'); |
54 if (!site) | 54 if (!site) |
55 return; | 55 return; |
56 this.browserProxy.getSiteDetails(site).then(function(siteInfo) { | 56 this.browserProxy.getSiteDetails(site).then(function(siteInfo) { |
57 this.site = siteInfo; | 57 this.site = this.expandSiteException(siteInfo); |
58 // TODO(dschuyler): set originForDisplay for fetchUsageTotal. | |
59 // TODO(dschuyler): set the page title to originForDisplay. | |
60 }.bind(this)); | 58 }.bind(this)); |
61 }, | 59 }, |
62 | 60 |
63 /** | 61 /** |
64 * Handler for when the origin changes. | 62 * Handler for when the origin changes. |
65 */ | 63 */ |
66 onSiteChanged_: function() { | 64 onSiteChanged_: function() { |
67 // originForDisplay may be initially undefined if the user follows a direct | 65 // originForDisplay may be initially undefined if the user follows a direct |
68 // link (URL) to this page. | 66 // link (URL) to this page. |
69 if (this.site.originForDisplay !== undefined) { | 67 if (this.site.originForDisplay !== undefined) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 112 |
115 /** | 113 /** |
116 * Returns true if one or more permission is showing. | 114 * Returns true if one or more permission is showing. |
117 */ | 115 */ |
118 permissionShowing_: function() { | 116 permissionShowing_: function() { |
119 return Array.prototype.some.call( | 117 return Array.prototype.some.call( |
120 this.root.querySelectorAll('site-details-permission'), | 118 this.root.querySelectorAll('site-details-permission'), |
121 function(element) { return element.offsetHeight > 0; }); | 119 function(element) { return element.offsetHeight > 0; }); |
122 }, | 120 }, |
123 }); | 121 }); |
OLD | NEW |