| 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 * 'settings-default-browser-page' is the settings page that contains | 7 * 'settings-default-browser-page' is the settings page that contains |
| 8 * settings to change the default browser (i.e. which the OS will open). | 8 * settings to change the default browser (i.e. which the OS will open). |
| 9 * | |
| 10 * Example: | |
| 11 * | |
| 12 * <iron-animated-pages> | |
| 13 * <settings-default-browser-page> | |
| 14 * </settings-default-browser-page> | |
| 15 * ... other pages ... | |
| 16 * </iron-animated-pages> | |
| 17 */ | 9 */ |
| 18 Polymer({ | 10 Polymer({ |
| 19 is: 'settings-default-browser-page', | 11 is: 'settings-default-browser-page', |
| 20 | 12 |
| 21 properties: { | 13 properties: { |
| 22 /** | 14 /** |
| 23 * The current active route. | 15 * The current active route. |
| 24 */ | 16 */ |
| 25 currentRoute: { | 17 currentRoute: { |
| 26 type: Object, | 18 type: Object, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 52 }, | 44 }, |
| 53 | 45 |
| 54 /** | 46 /** |
| 55 * Only show the SetAsDefault button if we have permission to set it. | 47 * Only show the SetAsDefault button if we have permission to set it. |
| 56 */ | 48 */ |
| 57 showButton_: { | 49 showButton_: { |
| 58 type: Boolean, | 50 type: Boolean, |
| 59 }, | 51 }, |
| 60 }, | 52 }, |
| 61 | 53 |
| 62 behaviors: [ | |
| 63 I18nBehavior, | |
| 64 ], | |
| 65 | |
| 66 ready: function() { | 54 ready: function() { |
| 67 var self = this; | 55 var self = this; |
| 68 cr.define('Settings', function() { | 56 cr.define('Settings', function() { |
| 69 return { | 57 return { |
| 70 setAsDefaultConcluded: function() { | 58 setAsDefaultConcluded: function() { |
| 71 return self.setAsDefaultConcluded_.apply(self, arguments); | 59 return self.setAsDefaultConcluded_.apply(self, arguments); |
| 72 }, | 60 }, |
| 73 updateDefaultBrowserState: function() { | 61 updateDefaultBrowserState: function() { |
| 74 return self.updateDefaultBrowserState_.apply(self, arguments); | 62 return self.updateDefaultBrowserState_.apply(self, arguments); |
| 75 }, | 63 }, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 99 canBeDefault ? 'defaultBrowserDefault' : 'defaultBrowserUnknown'); | 87 canBeDefault ? 'defaultBrowserDefault' : 'defaultBrowserUnknown'); |
| 100 } | 88 } |
| 101 }, | 89 }, |
| 102 | 90 |
| 103 /** @private */ | 91 /** @private */ |
| 104 onSetDefaultBrowserTap_: function() { | 92 onSetDefaultBrowserTap_: function() { |
| 105 this.startedSetAsDefault_ = true; | 93 this.startedSetAsDefault_ = true; |
| 106 chrome.send('SettingsDefaultBrowser.setAsDefaultBrowser'); | 94 chrome.send('SettingsDefaultBrowser.setAsDefaultBrowser'); |
| 107 }, | 95 }, |
| 108 }); | 96 }); |
| OLD | NEW |