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

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

Issue 2338213007: Adding JS and C++ handlers for events on new Welcome page. (Closed)
Patch Set: Further comments from anthonyvd Created 4 years, 3 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/welcome.js
diff --git a/chrome/browser/resources/welcome/welcome.js b/chrome/browser/resources/welcome/welcome.js
index 102537742e9aff3fbbeb2106553d968d56fa75e5..f22df5401c56e288abffc5855d70e8884416b5f9 100644
--- a/chrome/browser/resources/welcome/welcome.js
+++ b/chrome/browser/resources/welcome/welcome.js
@@ -2,5 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// TODO(tmartino): Add handlers.
-console.log('JS test');
+cr.define('welcome', function() {
+ 'use strict';
+
+ function onAccept(e) {
+ chrome.send('handleActivateSignIn');
+ }
+
+ function onDecline(e) {
+ chrome.send('handleUserDecline');
+ }
+
+ function initialize() {
+ $('accept-button').addEventListener('click', onAccept);
+ $('decline-button').addEventListener('click', onDecline);
+ }
+
+ return {
+ initialize: initialize
+ };
+});
+
michaelpg 2016/09/23 18:46:35 nit: remove extra blank line
+
+document.addEventListener('DOMContentLoaded', welcome.initialize);

Powered by Google App Engine
This is Rietveld 408576698