Chromium Code Reviews| Index: chrome/browser/resources/welcome/win10/inline.js |
| diff --git a/chrome/browser/resources/welcome/win10/inline.js b/chrome/browser/resources/welcome/win10/inline.js |
| index 02555f6b616419d7f0c3a8e0c5a0f6a11b8db6b8..e320befe8ca07c1e07d57d78c4b8f370fc47fcb2 100644 |
| --- a/chrome/browser/resources/welcome/win10/inline.js |
| +++ b/chrome/browser/resources/welcome/win10/inline.js |
| @@ -5,6 +5,12 @@ |
| cr.define('inline', function() { |
| 'use strict'; |
| + function computeClasses(isCombined) { |
| + if (isCombined) |
| + return 'section expandable expanded'; |
| + return 'section'; |
| + } |
| + |
| function onContinue() { |
| chrome.send('handleContinue'); |
| } |
| @@ -22,22 +28,31 @@ cr.define('inline', function() { |
| } |
| } |
| - function computeClasses(isCombined) { |
| - if (isCombined) |
| - return 'section expandable expanded'; |
| - return 'section'; |
| - } |
| - |
| function initialize() { |
| var app = $('inline-app'); |
| - app.isCombined = window.location.href.includes('variant=combined'); |
| + // Set variables. |
| + // Determines if the combined variant should be displayed. The combined |
| + // variant includes instructions on how to pin Chrome to the taskbar. |
| + app.isCombined = false; |
| // Set handlers. |
| app.computeClasses = computeClasses; |
| app.onContinue = onContinue; |
| app.onOpenSettings = onOpenSettings; |
| app.onToggle = onToggle.bind(this, app); |
| + |
| + // Asynchronously check if Chrome is pinned to the taskbar. |
| + cr.sendWithPromise('getPinnedToTaskbarState').then( |
| + function(isPinnedToTaskbar) { |
| + // Allow overriding of the result via a query parameter. |
| + if (window.location.href.includes('variant=defaultonly')) |
|
michaelpg
2016/11/04 21:27:03
Please use URLSearchParams: https://developer.mozi
Patrick Monette
2016/11/04 22:56:12
Done.
|
| + app.isCombined = false; |
| + else if (window.location.href.includes('variant=combined')) |
| + app.isCombined = true; |
| + else |
| + app.isCombined = !isPinnedToTaskbar; |
| + }); |
| } |
| return { |