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

Side by Side Diff: chrome/browser/resources/settings/about_page/detailed_build_info.js

Issue 1987813004: MD Settings: About page, implementing update status. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing. 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 'settings-detailed-build-info' contains detailed build 6 * @fileoverview 'settings-detailed-build-info' contains detailed build
7 * information for ChromeOS. 7 * information for ChromeOS.
8 */ 8 */
9 9
10 (function() {
11
12 /**
13 * @param {!BrowserChannel} channel
14 * @return {string}
15 */
16 function browserChannelToI18nId(channel) {
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({ 10 Polymer({
27 is: 'settings-detailed-build-info', 11 is: 'settings-detailed-build-info',
28 12
29 behaviors: [I18nBehavior], 13 behaviors: [I18nBehavior],
30 14
31 properties: { 15 properties: {
32 /** @private {!VersionInfo} */ 16 /** @private {!VersionInfo} */
33 versionInfo_: Object, 17 versionInfo_: Object,
34 18
35 /** @private */ 19 /** @private */
36 currentlyOnChannelText_: String, 20 currentlyOnChannelText_: String,
37 }, 21 },
38 22
39 /** @override */ 23 /** @override */
40 ready: function() { 24 ready: function() {
41 var browserProxy = settings.AboutPageBrowserProxyImpl.getInstance(); 25 var browserProxy = settings.AboutPageBrowserProxyImpl.getInstance();
42 browserProxy.pageReady(); 26 browserProxy.pageReady();
43 27
44 browserProxy.getVersionInfo().then(function(versionInfo) { 28 browserProxy.getVersionInfo().then(function(versionInfo) {
45 this.versionInfo_ = versionInfo; 29 this.versionInfo_ = versionInfo;
46 }.bind(this)); 30 }.bind(this));
47 browserProxy.getCurrentChannel().then(function(channel) { 31 browserProxy.getCurrentChannel().then(function(channel) {
48 this.currentlyOnChannelText_ = this.i18n( 32 this.currentlyOnChannelText_ = this.i18n(
49 'aboutCurrentlyOnChannel', 33 'aboutCurrentlyOnChannel',
50 this.i18n(browserChannelToI18nId(channel))); 34 this.i18n(settings.browserChannelToI18nId(channel)));
51 }.bind(this)); 35 }.bind(this));
52 }, 36 },
53 37
54 /** 38 /**
55 * @param {string} version 39 * @param {string} version
56 * @return {boolean} 40 * @return {boolean}
57 * @private 41 * @private
58 */ 42 */
59 shouldShowVersion_: function(version) { 43 shouldShowVersion_: function(version) {
60 return version.length > 0; 44 return version.length > 0;
61 }, 45 },
62 }); 46 });
63
64 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698