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

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

Issue 2401853005: Adding client code for new Windows 10 First Run Experience (Closed)
Patch Set: Adding Readme Created 4 years, 2 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 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
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);
« no previous file with comments | « chrome/browser/resources/welcome/win10/inline.html ('k') | chrome/browser/resources/welcome/win10/sectioned.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698