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

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

Issue 2338213007: Adding JS and C++ handlers for events on new Welcome page. (Closed)
Patch Set: Forward Declarations 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..a68333a2817e9fbc36d7bc55a2c2f52cdfb1ee74 100644
--- a/chrome/browser/resources/welcome/welcome.js
+++ b/chrome/browser/resources/welcome/welcome.js
@@ -2,5 +2,25 @@
// 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
+ };
+});
+
+document.addEventListener('DOMContentLoaded', welcome.initialize);

Powered by Google App Engine
This is Rietveld 408576698