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

Side by Side Diff: remoting/webapp/crd/js/hangout_consent_dialog_main.js

Issue 888323002: Improve HRD first run experience (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 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 /**
6 * @fileoverview
7 * The entry point for dialog_hangout_consent.html.
8 */
9
10
11 /** @suppress {duplicate} */
12 var remoting = remoting || {};
13
14 (function() {
15
16 'use strict';
17
18 /**
19 * @constructor
20 * @param {HTMLElement} rootElement
21 * @param {boolean} authenticated whether the user is authenticated or not.
22 */
23 var ConsentDialog = function(rootElement, authenticated) {
24 /** @private */
25 this.okButton_ = rootElement.querySelector('.ok-button');
26 /** @private */
27 this.cancelButton_ = rootElement.querySelector('.cancel-button');
28 /** @private */
29 this.authSection_ = rootElement.querySelector('.auth-message');
30
31 if (authenticated) {
32 this.authSection_.hidden = true;
33 }
34
35 this.okButton_.addEventListener('click', this.onButton_.bind(this, true));
36 this.cancelButton_.addEventListener('click',this.onButton_.bind(this, false));
37 };
38
39 /**
40 * @param {boolean} confirm
41 * @private
42 */
43 ConsentDialog.prototype.onButton_ = function(confirm) {
44 base.Ipc.invoke('remoting.HangoutConsentDialog.confirm', confirm);
45 chrome.app.window.current().close();
46 };
47
48 function onDomContentLoaded() {
49 var params = base.getUrlParameters();
50 var isAuthenticated = (params['authenticated'] === 'true');
51 l10n.localize();
52 var confirmDialog = new ConsentDialog(document.body, isAuthenticated);
53 }
54
55 document.addEventListener("DOMContentLoaded", onDomContentLoaded);
Jamie 2015/02/02 19:07:40 Single-quotes for JS strings, please. Elsewhere,
kelvinp 2015/02/03 01:15:33 Excellent catch! Thank you.
56
57 }());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698