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

Side by Side Diff: chrome/browser/resources/chromeos/login/ad_ui.js

Issue 2433363004: Chromad: added AD Join ui, authpolicy_client (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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 Polymer((function() {
6 return {
7 is: 'ad-ui',
8
9 properties: {
10 disabled: {
11 type: Boolean,
12 value: false,
13 observer: '_disabledChanged'
14 },
15 showMachineInput: {
16 type: Boolean,
17 value: false
18 },
19 realm: {
20 type: String,
21 observer: 'onRealmChanged_'
22 },
23 userRealm: String,
24 adWelcomeMessage: String
25 },
26
27 focus: function() {
28 if (this.$.machineNameInput.value == '') {
29 this.$.machineNameInput.focus();
30 } else if (this.$.userInput.value == '') {
31 this.$.userInput.focus();
32 } else {
33 this.$.passwordInput.focus();
34 }
35 },
36
37 onRealmChanged_: function() {
38 this.$.welcomeMsg.textContent =
39 loadTimeData.getStringF('ADAuthWelcomeMessage', this.realm);
40 },
41
42 setUser: function(user, machineName) {
43 if (user) {
44 this.$.userInput.value = user;
45 this.$.passwordInput.isInvalid = true;
46 } else {
47 this.$.userInput.value = '';
48 this.$.passwordInput.isInvalid = false;
49 }
50 this.$.machineNameInput.value = machineName || '';
51 this.$.passwordInput.value = '';
52 this.focus();
53 },
54
55 isRTL_: function() {
56 return !!document.querySelector('html[dir=rtl]');
57 },
58
59 onSubmit_: function() {
60 if (!this.$.passwordInput.checkValidity())
61 return;
62 var user = this.$.userInput.value;
63 if (user.indexOf('@') === -1) {
64 if (this.userRealm)
65 user = user + this.userRealm;
66 }
67 var msg = {
68 'machinename': this.$.machineNameInput.value,
69 'username': user,
70 'password': this.$.passwordInput.value
71 };
72 this.$.passwordInput.value = '';
73 this.fire('authCompleted', msg);
74 },
75
76 _disabledChanged: function(newValue, oldValue) {
77 if (newValue)
78 this.$.gaiaCard.classList.add('disabled');
79 else
80 this.$.gaiaCard.classList.remove('disabled');
81 }
82 };
83 })());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698