Chromium Code Reviews| Index: chrome/browser/resources/settings/about_page/detailed_build_info.js |
| diff --git a/chrome/browser/resources/settings/about_page/detailed_build_info.js b/chrome/browser/resources/settings/about_page/detailed_build_info.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2296485ec1201faaa4759f952fd18679f22e09b9 |
| --- /dev/null |
| +++ b/chrome/browser/resources/settings/about_page/detailed_build_info.js |
| @@ -0,0 +1,64 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +/** |
| + * @fileoverview 'settings-detailed-build-info' contains detailed build |
| + * information for ChromeOS. |
| + */ |
| + |
| +(function() { |
| + |
| +/** |
| + * @param {!BrowserChannel} channel |
| + * @return {string} |
| + */ |
| +function browserChannelToI18nId(channel) { |
|
tommycli
2016/05/13 18:24:26
I would suggest if it's only used once, to just in
dpapad
2016/05/13 19:28:02
Thought about this. If I inline it then I can no l
|
| + switch (channel) { |
| + case BrowserChannel.BETA: return 'aboutChannelBeta'; |
| + case BrowserChannel.DEV: return 'aboutChannelDev'; |
| + case BrowserChannel.STABLE: return 'aboutChannelStable'; |
| + } |
| + |
| + assertNotReached(); |
| +} |
| + |
| +Polymer({ |
| + is: 'settings-detailed-build-info', |
| + |
| + behaviors: [I18nBehavior], |
| + |
| + properties: { |
| + /** @private {!VersionInfo} */ |
| + versionInfo_: Object, |
| + |
| + /** @private */ |
| + currentlyOnChannelText_: String, |
| + }, |
| + |
| + /** @override */ |
| + ready: function() { |
| + var browserProxy = settings.AboutPageBrowserProxyImpl.getInstance(); |
| + browserProxy.refreshUpdateStatus(); |
| + |
| + browserProxy.getVersionInfo().then(function(versionInfo) { |
| + this.versionInfo_ = versionInfo; |
| + }.bind(this)); |
| + browserProxy.getCurrentChannel().then(function(channel) { |
| + this.currentlyOnChannelText_ = this.i18n( |
| + 'aboutCurrentlyOnChannel', |
| + this.i18n(browserChannelToI18nId(channel))); |
| + }.bind(this)); |
| + }, |
| + |
| + /** |
| + * @param {string} version |
| + * @return {boolean} |
| + * @private |
| + */ |
| + shouldShowVersion_: function(version) { |
| + return version.length > 0; |
| + }, |
| +}); |
| + |
| +})(); |