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

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

Issue 2010653003: MD Settings: About page, implementing channel switcher dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup 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 A helper object used from the "About" section to interact with 6 * @fileoverview A helper object used from the "About" section to interact with
7 * the browser. 7 * the browser.
8 */ 8 */
9 9
10 <if expr="chromeos"> 10 <if expr="chromeos">
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 function browserChannelToI18nId(channel) { 68 function browserChannelToI18nId(channel) {
69 switch (channel) { 69 switch (channel) {
70 case BrowserChannel.BETA: return 'aboutChannelBeta'; 70 case BrowserChannel.BETA: return 'aboutChannelBeta';
71 case BrowserChannel.DEV: return 'aboutChannelDev'; 71 case BrowserChannel.DEV: return 'aboutChannelDev';
72 case BrowserChannel.STABLE: return 'aboutChannelStable'; 72 case BrowserChannel.STABLE: return 'aboutChannelStable';
73 } 73 }
74 74
75 assertNotReached(); 75 assertNotReached();
76 } 76 }
77 77
78 /**
79 * @param {!BrowserChannel} currentChannel
80 * @param {!BrowserChannel} targetChannel
81 * @return {boolean} Whether the target channel is more stable than the
82 * current channel.
83 */
84 function isTargetChannelMoreStable(currentChannel, targetChannel) {
85 // List of channels in increasing stability order.
86 var channelList = [
87 BrowserChannel.DEV,
88 BrowserChannel.BETA,
89 BrowserChannel.STABLE,
90 ];
91 var currentIndex = channelList.indexOf(currentChannel);
92 var targetIndex = channelList.indexOf(targetChannel);
93 return currentIndex < targetIndex;
94 }
95
78 /** @interface */ 96 /** @interface */
79 function AboutPageBrowserProxy() {} 97 function AboutPageBrowserProxy() {}
80 98
81 AboutPageBrowserProxy.prototype = { 99 AboutPageBrowserProxy.prototype = {
82 /** 100 /**
83 * Indicates to the browser that the page is ready. 101 * Indicates to the browser that the page is ready.
84 */ 102 */
85 pageReady: function() {}, 103 pageReady: function() {},
86 104
87 /** 105 /**
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 getRegulatoryInfo: function() { 214 getRegulatoryInfo: function() {
197 return cr.sendWithPromise('getRegulatoryInfo'); 215 return cr.sendWithPromise('getRegulatoryInfo');
198 } 216 }
199 </if> 217 </if>
200 }; 218 };
201 219
202 return { 220 return {
203 AboutPageBrowserProxy: AboutPageBrowserProxy, 221 AboutPageBrowserProxy: AboutPageBrowserProxy,
204 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl, 222 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl,
205 browserChannelToI18nId: browserChannelToI18nId, 223 browserChannelToI18nId: browserChannelToI18nId,
224 isTargetChannelMoreStable: isTargetChannelMoreStable,
206 }; 225 };
207 }); 226 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698