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

Side by Side Diff: chrome/browser/resources/welcome/win10/sectioned.js

Issue 2401853005: Adding client code for new Windows 10 First Run Experience (Closed)
Patch Set: Adding Readme 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/welcome/win10/sectioned.html ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 cr.define('sectioned', function() {
6 'use strict';
7
8 function onContinue() {
9 chrome.send('handleContinue');
10 }
11
12 function onOpenSettings() {
13 chrome.send('handleSetDefaultBrowser');
14 }
15
16 function onToggle(app) {
17 if (app.isCombined) {
18 // Toggle sections.
19 var sections = document.querySelectorAll('.section.expandable');
20 sections.forEach(function(section) {
21 section.classList.toggle('expanded');
22 });
23 // Toggle screenshots.
24 var screenshots = document.querySelectorAll('.screenshot-image');
25 screenshots.forEach(function(screenshot) {
26 screenshot.classList.toggle('hidden');
27 });
28 }
29 }
30
31 function computeClasses(isCombined) {
32 if (isCombined)
33 return 'section expandable expanded';
34 return 'section';
35 }
36
37 function initialize() {
38 var app = $('sectioned-app');
39
40 app.isCombined = window.location.href.includes('variant=combined');
41
42 // Set handlers.
43 app.computeClasses = computeClasses;
44 app.onContinue = onContinue;
45 app.onOpenSettings = onOpenSettings;
46 app.onToggle = onToggle.bind(this, app);
47 }
48
49 return {
50 initialize: initialize
51 };
52 });
53
54 document.addEventListener('DOMContentLoaded', sectioned.initialize);
OLDNEW
« no previous file with comments | « chrome/browser/resources/welcome/win10/sectioned.html ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698