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

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

Issue 2029453002: MD Settings: About page, implement obsolete/end-of-the-line status. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comment. Created 4 years, 6 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-about-page' contains version and OS related 6 * @fileoverview 'settings-about-page' contains version and OS related
7 * information. 7 * information.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-about-page', 10 is: 'settings-about-page',
(...skipping 18 matching lines...) Expand all
29 29
30 /** @private {!BrowserChannel} */ 30 /** @private {!BrowserChannel} */
31 currentChannel_: String, 31 currentChannel_: String,
32 32
33 /** @private {!BrowserChannel} */ 33 /** @private {!BrowserChannel} */
34 targetChannel_: String, 34 targetChannel_: String,
35 35
36 /** @private {?RegulatoryInfo} */ 36 /** @private {?RegulatoryInfo} */
37 regulatoryInfo_: Object, 37 regulatoryInfo_: Object,
38 </if> 38 </if>
39
40 /** @private {!{obsolete: boolean, endOfLine: boolean}} */
41 obsoleteSystemInfo_: {
42 type: Object,
43 value: function() {
44 return {
45 obsolete: loadTimeData.getBoolean('aboutObsoleteNowOrSoon'),
46 endOfLine: loadTimeData.getBoolean('aboutObsoleteEndOfTheLine'),
47 };
48 },
49 },
39 }, 50 },
40 51
41 /** @private {?settings.AboutPageBrowserProxy} */ 52 /** @private {?settings.AboutPageBrowserProxy} */
42 browserProxy_: null, 53 browserProxy_: null,
43 54
44 /** 55 /**
45 * @type {string} Selector to get the sections. 56 * @type {string} Selector to get the sections.
46 * TODO(michaelpg): replace duplicate docs with @override once b/24294625 57 * TODO(michaelpg): replace duplicate docs with @override once b/24294625
47 * is fixed. 58 * is fixed.
48 */ 59 */
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 117
107 /** @private */ 118 /** @private */
108 onRelaunchTap_: function() { 119 onRelaunchTap_: function() {
109 this.browserProxy_.relaunchNow(); 120 this.browserProxy_.relaunchNow();
110 }, 121 },
111 122
112 /** 123 /**
113 * @return {boolean} 124 * @return {boolean}
114 * @private 125 * @private
115 */ 126 */
116 shouldShowUpdateStatus_: function() { 127 shouldShowUpdateStatusMessage_: function() {
117 return this.currentUpdateStatusEvent_.status != UpdateStatus.DISABLED; 128 return this.currentUpdateStatusEvent_.status != UpdateStatus.DISABLED &&
129 !this.obsoleteSystemInfo_.endOfLine;
118 }, 130 },
119 131
120 /** 132 /**
133 * @return {boolean}
134 * @private
135 */
136 shouldShowUpdateStatusIcon_: function() {
137 return this.currentUpdateStatusEvent_.status != UpdateStatus.DISABLED ||
138 this.obsoleteSystemInfo_.endOfLine;
139 },
140
141 /**
121 * @return {boolean} 142 * @return {boolean}
122 * @private 143 * @private
123 */ 144 */
124 shouldShowRelaunch_: function() { 145 shouldShowRelaunch_: function() {
125 var shouldShow = false; 146 var shouldShow = false;
126 <if expr="not chromeos"> 147 <if expr="not chromeos">
127 shouldShow = this.checkStatus_(UpdateStatus.NEARLY_UPDATED); 148 shouldShow = this.checkStatus_(UpdateStatus.NEARLY_UPDATED);
128 </if> 149 </if>
129 <if expr="chromeos"> 150 <if expr="chromeos">
130 shouldShow = this.checkStatus_(UpdateStatus.NEARLY_UPDATED) && 151 shouldShow = this.checkStatus_(UpdateStatus.NEARLY_UPDATED) &&
(...skipping 29 matching lines...) Expand all
160 default: 181 default:
161 return this.currentUpdateStatusEvent_.message || ''; 182 return this.currentUpdateStatusEvent_.message || '';
162 } 183 }
163 }, 184 },
164 185
165 /** 186 /**
166 * @return {?string} 187 * @return {?string}
167 * @private 188 * @private
168 */ 189 */
169 getIcon_: function() { 190 getIcon_: function() {
191 // If this platform has reached the end of the line, display an error icon
192 // and ignore UpdateStatus.
193 if (this.obsoleteSystemInfo_.endOfLine)
194 return 'settings:error';
195
170 switch (this.currentUpdateStatusEvent_.status) { 196 switch (this.currentUpdateStatusEvent_.status) {
171 case UpdateStatus.DISABLED_BY_ADMIN: 197 case UpdateStatus.DISABLED_BY_ADMIN:
172 return 'cr:domain'; 198 return 'cr:domain';
173 case UpdateStatus.FAILED: 199 case UpdateStatus.FAILED:
174 return 'settings:error'; 200 return 'settings:error';
175 case UpdateStatus.UPDATED: 201 case UpdateStatus.UPDATED:
176 case UpdateStatus.NEARLY_UPDATED: 202 case UpdateStatus.NEARLY_UPDATED:
177 return 'settings:check-circle'; 203 return 'settings:check-circle';
178 default: 204 default:
179 return null; 205 return null;
180 } 206 }
181 }, 207 },
182 208
183 /** 209 /**
184 * @return {?string} 210 * @return {?string}
185 * @private 211 * @private
186 */ 212 */
187 getIconSrc_: function() { 213 getIconSrc_: function() {
214 if (this.obsoleteSystemInfo_.endOfLine)
215 return null;
216
188 switch (this.currentUpdateStatusEvent_.status) { 217 switch (this.currentUpdateStatusEvent_.status) {
189 case UpdateStatus.CHECKING: 218 case UpdateStatus.CHECKING:
190 case UpdateStatus.UPDATING: 219 case UpdateStatus.UPDATING:
191 return 'chrome://resources/images/throbber_small.svg'; 220 return 'chrome://resources/images/throbber_small.svg';
192 default: 221 default:
193 return null; 222 return null;
194 } 223 }
195 }, 224 },
196 225
197 /** 226 /**
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 }, 289 },
261 </if> 290 </if>
262 291
263 <if expr="_google_chrome"> 292 <if expr="_google_chrome">
264 /** @private */ 293 /** @private */
265 onReportIssueTap_: function() { 294 onReportIssueTap_: function() {
266 this.browserProxy_.openFeedbackDialog(); 295 this.browserProxy_.openFeedbackDialog();
267 }, 296 },
268 </if> 297 </if>
269 }); 298 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/about_page/about_page.html ('k') | chrome/browser/ui/webui/settings/about_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698