| 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 Behavior common to Site Settings classes. | 6 * @fileoverview Behavior common to Site Settings classes. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 /** @polymerBehavior */ | 9 /** @polymerBehavior */ |
| 10 var SiteSettingsBehaviorImpl = { | 10 var SiteSettingsBehaviorImpl = { |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 * @return {string} The background-image style with the favicon. | 390 * @return {string} The background-image style with the favicon. |
| 391 * @private | 391 * @private |
| 392 */ | 392 */ |
| 393 computeSiteIcon: function(site) { | 393 computeSiteIcon: function(site) { |
| 394 var url = this.ensureUrlHasScheme(site); | 394 var url = this.ensureUrlHasScheme(site); |
| 395 return 'background-image: ' + cr.icon.getFavicon(url); | 395 return 'background-image: ' + cr.icon.getFavicon(url); |
| 396 }, | 396 }, |
| 397 | 397 |
| 398 /** | 398 /** |
| 399 * Returns true if the passed content setting is considered 'enabled'. | 399 * Returns true if the passed content setting is considered 'enabled'. |
| 400 * @param {string} category | |
| 401 * @param {string} setting | 400 * @param {string} setting |
| 402 * @return {boolean} | 401 * @return {boolean} |
| 403 * @private | 402 * @private |
| 404 */ | 403 */ |
| 405 computeIsSettingEnabled: function(category, setting) { | 404 computeIsSettingEnabled: function(setting) { |
| 406 // FullScreen is Allow vs. Ask. | 405 return setting != settings.PermissionValues.BLOCK; |
| 407 return category == settings.ContentSettingsTypes.FULLSCREEN ? | |
| 408 setting != settings.PermissionValues.ASK : | |
| 409 setting != settings.PermissionValues.BLOCK; | |
| 410 }, | 406 }, |
| 411 | 407 |
| 412 /** | 408 /** |
| 413 * Converts a string origin/pattern to a URL. | 409 * Converts a string origin/pattern to a URL. |
| 414 * @param {string} originOrPattern The origin/pattern to convert to URL. | 410 * @param {string} originOrPattern The origin/pattern to convert to URL. |
| 415 * @return {URL} The URL to return (or null if origin is not a valid URL). | 411 * @return {URL} The URL to return (or null if origin is not a valid URL). |
| 416 * @private | 412 * @private |
| 417 */ | 413 */ |
| 418 toUrl: function(originOrPattern) { | 414 toUrl: function(originOrPattern) { |
| 419 if (originOrPattern.length == 0) | 415 if (originOrPattern.length == 0) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 incognito: exception.incognito, | 451 incognito: exception.incognito, |
| 456 setting: exception.setting, | 452 setting: exception.setting, |
| 457 source: exception.source, | 453 source: exception.source, |
| 458 }; | 454 }; |
| 459 }, | 455 }, |
| 460 | 456 |
| 461 }; | 457 }; |
| 462 | 458 |
| 463 /** @polymerBehavior */ | 459 /** @polymerBehavior */ |
| 464 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; | 460 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; |
| OLD | NEW |