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

Unified Diff: chrome/browser/resources/settings/about_page/detailed_build_info.js

Issue 1975003002: MD Settings: About page, implementing detailed build info. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
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;
+ },
+});
+
+})();

Powered by Google App Engine
This is Rietveld 408576698