forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ChromeOS Gaia: SAML password confirmation dialog
Known issues: -Cancel confirmation dialog and backdrop style should be according to crbug/482962 -Cancel confirmation dialog doesn't cover "account creation" case -Fatal error does not use 'notification-card' element. BUG=467119,469428 TEST=Manual TBR=grt@chromium.org Review URL: https://codereview.chromium.org/1115993002 Cr-Commit-Position: refs/heads/master@{#329243}
- Loading branch information
rsorokin
authored and
Commit bot
committed
May 11, 2015
1 parent
e5cc32e
commit 3d1921c
Showing
25 changed files
with
296 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ Polymer('gaia-input', (function() { | |
|
||
domainChanged: function() { | ||
this.setDomainVisibility(); | ||
} | ||
}, | ||
}; | ||
})()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,3 @@ core-icon[icon='warning'] { | |
left: 0; | ||
right: auto; | ||
} | ||
|
||
div.margined { | ||
margin-bottom: 24px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
chrome/browser/resources/chromeos/login/saml_confirm_password.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* Copyright 2015 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. | ||
*/ | ||
|
||
#closeButton { | ||
color: rgb(255, 255, 255); | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
|
||
:host-context(html[dir=rtl]) #closeButton { | ||
left: 0; | ||
right: auto; | ||
} | ||
|
||
#cancelConfirmDlg { | ||
position: absolute; | ||
width: 384px; | ||
} |
75 changes: 75 additions & 0 deletions
75
chrome/browser/resources/chromeos/login/saml_confirm_password.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<link rel="import" href="chrome://resources/polymer/polymer/polymer.html"> | ||
<link rel="import" href="chrome://resources/polymer/polymer/layout.html"> | ||
<link rel="import" href="chrome://resources/polymer/core-animated-pages/core-animated-pages.html"> | ||
<link rel="import" href="chrome://resources/polymer/core-animated-pages/transitions/cross-fade.html"> | ||
|
||
<!-- | ||
SAML password confirmation UI for the New Gaia flow. | ||
Contains two cards with a fade transition between them: | ||
1. Password input form. | ||
2. Spinner with notice "Please wait"; | ||
Example: | ||
<saml-confirm-password id="saml-confirm-password" hidden> | ||
</saml-confirm-password> | ||
Attributes: | ||
'email' - Displayed email in header. | ||
Events: | ||
'passwordEnter' - Fired when user enters password. Fires with an argument | ||
|password|. | ||
'cancel' - Fired when user presses the X-button and then presses YES | ||
in the cancel confirmation dialog. | ||
Methods: | ||
'invalidate' - Mark password input as invalid. | ||
'reset' - Reset element, switches to the first screen, closes | ||
the confirm dialog, displays the close button, | ||
empties password field and enables buttons. | ||
'focus' - If the current card is the first one, focuses password input. | ||
--> | ||
<polymer-element name="saml-confirm-password" vertical layout | ||
attributes="email"> | ||
<template> | ||
<link rel="stylesheet" href="saml_confirm_password.css"> | ||
<gaia-core-icon-button id="closeButton" icon="close" on-tap="{{onClose}}"> | ||
</gaia-core-icon-button> | ||
<core-animated-pages id="animatedPages" transitions="cross-fade-all" flex | ||
on-core-animated-pages-transition-end="{{onTransitionEnd}}"> | ||
<section flex> | ||
<gaia-card id="confirmPasswordCard"> | ||
<gaia-header class="header" email="{{email}}"> | ||
</gaia-header> | ||
<div horizontal layout center class="footer gaia-body-text"> | ||
<p i18n-content="confirmPasswordTitle"> | ||
</p> | ||
</div> | ||
<gaia-input-form id="inputForm" class="footer" | ||
on-submit="{{onPasswordSubmitted}}" | ||
i18n-values="buttonText:nextButtonText"> | ||
<gaia-input id="passwordInput" type="password" required | ||
i18n-values="error:confirmPasswordIncorrectPassword; | ||
label:confirmPasswordLabel;"> | ||
</gaia-input> | ||
</gaia-input-form> | ||
<paper-action-dialog class="footer" id="cancelConfirmDlg" | ||
layered="false"> | ||
<p i18n-content="accountSetupCancelDialogTitle"></p> | ||
<gaia-paper-button class="dialog-action-button" affirmative | ||
autofocus i18n-content="accountSetupCancelDialogNo"> | ||
</gaia-paper-button> | ||
<gaia-paper-button id="confirmCancel" on-tap="{{onConfirmCancel}}" | ||
class="dialog-action-button" affirmative | ||
i18n-content="accountSetupCancelDialogYes"> | ||
</gaia-paper-button> | ||
</paper-action-dialog> | ||
</gaia-card> | ||
</section> | ||
<section flex vertical layout center-justified> | ||
<throbber-notice i18n-values="text:gaiaLoadingNewGaia" self-center> | ||
</throbber-notice> | ||
</section> | ||
</core-animated-pages> | ||
</template> | ||
</polymer-element> |
57 changes: 57 additions & 0 deletions
57
chrome/browser/resources/chromeos/login/saml_confirm_password.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* Copyright 2015 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. | ||
*/ | ||
|
||
Polymer('saml-confirm-password', { | ||
onClose: function() { | ||
this.disabled = true; | ||
this.$.cancelConfirmDlg.toggle(); | ||
}, | ||
|
||
onConfirmCancel: function() { | ||
this.fire('cancel'); | ||
}, | ||
|
||
reset: function() { | ||
this.$.cancelConfirmDlg.close(); | ||
this.disabled = false; | ||
this.$.closeButton.hidden = false; | ||
this.$.animatedPages.selected = 0; | ||
this.$.passwordInput.value = ''; | ||
}, | ||
|
||
invalidate: function() { | ||
this.$.passwordInput.isInvalid = true; | ||
}, | ||
|
||
focus: function() { | ||
if (this.$.animatedPages.selected == 0) | ||
this.$.passwordInput.focus(); | ||
}, | ||
|
||
onPasswordSubmitted: function() { | ||
var inputPassword = this.$.passwordInput.value; | ||
this.$.passwordInput.value = ''; | ||
if (!inputPassword) { | ||
this.invalidate(); | ||
} else { | ||
this.$.animatedPages.selected += 1; | ||
this.$.closeButton.hidden = true; | ||
this.fire('passwordEnter', {password: inputPassword}); | ||
} | ||
}, | ||
|
||
set disabled(value) { | ||
this.$.confirmPasswordCard.classList.toggle('full-disabled', value); | ||
this.$.inputForm.disabled = value; | ||
this.$.closeButton.disabled = value; | ||
}, | ||
|
||
ready: function() { | ||
this.$.cancelConfirmDlg.addEventListener('core-overlay-close-completed', | ||
function() { | ||
this.disabled = false; | ||
}.bind(this)); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.