| 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
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..02555f6b616419d7f0c3a8e0c5a0f6a11b8db6b8
|
| --- /dev/null
|
| +++ b/chrome/browser/resources/welcome/win10/inline.js
|
| @@ -0,0 +1,48 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +cr.define('inline', function() {
|
| + 'use strict';
|
| +
|
| + function onContinue() {
|
| + chrome.send('handleContinue');
|
| + }
|
| +
|
| + function onOpenSettings() {
|
| + chrome.send('handleSetDefaultBrowser');
|
| + }
|
| +
|
| + function onToggle(app) {
|
| + if (app.isCombined) {
|
| + var sections = document.querySelectorAll('.section.expandable');
|
| + sections.forEach(function(section) {
|
| + section.classList.toggle('expanded');
|
| + });
|
| + }
|
| + }
|
| +
|
| + 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 handlers.
|
| + app.computeClasses = computeClasses;
|
| + app.onContinue = onContinue;
|
| + app.onOpenSettings = onOpenSettings;
|
| + app.onToggle = onToggle.bind(this, app);
|
| + }
|
| +
|
| + return {
|
| + initialize: initialize
|
| + };
|
| +});
|
| +
|
| +document.addEventListener('DOMContentLoaded', inline.initialize);
|
|
|