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

Unified Diff: chrome/browser/resources/welcome/win10/inline.js

Issue 2449853008: Determine the Win10-specific Welcome page variant to display (Closed)
Patch Set: Nit Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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..c659bdcb9ec8c4e601bbe84d350dd5b17a7744ea 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,25 @@ 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) {
+ app.isCombined = !isPinnedToTaskbar;
+ });
}
return {
« no previous file with comments | « no previous file | chrome/browser/resources/welcome/win10/sectioned.js » ('j') | chrome/browser/ui/webui/welcome_win10_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698