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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview 'settings-detailed-build-info' contains detailed build
7 * information for ChromeOS.
8 */
9
10 (function() {
11
12 /**
13 * @param {!BrowserChannel} channel
14 * @return {string}
15 */
16 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
17 switch (channel) {
18 case BrowserChannel.BETA: return 'aboutChannelBeta';
19 case BrowserChannel.DEV: return 'aboutChannelDev';
20 case BrowserChannel.STABLE: return 'aboutChannelStable';
21 }
22
23 assertNotReached();
24 }
25
26 Polymer({
27 is: 'settings-detailed-build-info',
28
29 behaviors: [I18nBehavior],
30
31 properties: {
32 /** @private {!VersionInfo} */
33 versionInfo_: Object,
34
35 /** @private */
36 currentlyOnChannelText_: String,
37 },
38
39 /** @override */
40 ready: function() {
41 var browserProxy = settings.AboutPageBrowserProxyImpl.getInstance();
42 browserProxy.refreshUpdateStatus();
43
44 browserProxy.getVersionInfo().then(function(versionInfo) {
45 this.versionInfo_ = versionInfo;
46 }.bind(this));
47 browserProxy.getCurrentChannel().then(function(channel) {
48 this.currentlyOnChannelText_ = this.i18n(
49 'aboutCurrentlyOnChannel',
50 this.i18n(browserChannelToI18nId(channel)));
51 }.bind(this));
52 },
53
54 /**
55 * @param {string} version
56 * @return {boolean}
57 * @private
58 */
59 shouldShowVersion_: function(version) {
60 return version.length > 0;
61 },
62 });
63
64 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698