summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/chromeos/login/offline_gaia.html
blob: 32a262c687a806e97c788f3d31633b3f727ee80d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!-- 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. -->

<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animations/slide-from-left-animation.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animations/slide-from-right-animation.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animations/slide-left-animation.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animations/slide-right-animation.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animated-pages.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-dialog/paper-dialog.html">
<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">

<!--
  Offline UI for the New Gaia flow.
  Contains two cards with a slide transition between them:
    1. Email input form.
    2. Password input form.

  Example:
    <offline-gaia></offline-gaia>

  Attributes:
    'enterpriseInfo' - Information about device management.
    'emailDomain' - autocomplete domain for the email input.

  Events:
    'authCompleted' - fired when user enters login and password. Fires with an
                      argument |credentials| which contains.
                      |credentials| = { 'useOffline': true,
                                        'email': <email>,
                                        'password': <typed password> }
                      If user did not type domain |email| will be added by
                      "@gmail.com" or by 'emailDomain' if it is set.
  Methods:
    'focus' - focuses current screen (email input or password input);
    'setEmail' - accepts an argument |email|. If |email| is empty it sets
                 current screen to the email input, otherwise it sets current
                 screen to password input and shows error that previously
                 entered password is incorrect.
-->
<dom-module name="offline-gaia">
  <link rel="stylesheet" href="offline_gaia.css">

  <template>
    <neon-animated-pages id="animatedPages" class="fit" attr-for-selected="id"
        entry-animation="slide-from-right-animation"
        exit-animation="slide-to-left-animation"
        on-neon-animation-finish="onAnimationFinish_" selected="emailSection">

      <neon-animatable id="emailSection" class="fit">
        <gaia-card class="fit">
          <div class="header flex vertical layout end-justified start">
            <h1 class="welcome-message" i18n-content="offlineLoginWelcome"></h1>
            <p class="enterprise-info"  hidden$="[[!enterpriseInfo]]">
              <span>[[enterpriseInfo]]</span>
            </p>
          </div>
          <div class="footer flex vertical layout justified">
            <gaia-input-form on-submit="onEmailSubmitted_"
                disabled="[[disabled]]"
                i18n-values="button-text:offlineLoginNextBtn">
              <gaia-input id="emailInput" type="email" required
                  domain="[[emailDomain]]"
                  i18n-values="error:offlineLoginInvalidEmail;
                               label:offlineLoginEmail">
              </gaia-input>
            </gaia-input-form>
            <img src="chrome://theme/IDR_LOGO_GOOGLE_COLOR_90"
                class="self-center" alt="">
          </div>
        </gaia-card>
      </neon-animatable>

      <neon-animatable id="passwordSection" class="fit">
        <gaia-card id="passwordCard" class="fit">
          <gaia-header class="header flex" id="passwordHeader">
          </gaia-header>
          <gaia-input-form class="footer" disabled="[[disabled]]"
              on-submit="onPasswordSubmitted_"
              i18n-values="button-text:offlineLoginNextBtn">
            <gaia-input id="passwordInput" type="password" required
                i18n-values="error:offlineLoginInvalidPassword;
                             label:offlineLoginPassword">
            </gaia-input>
            <gaia-button type="link" on-tap="onForgotPasswordClicked_"
                i18n-content="offlineLoginForgotPasswordBtn">
            </gaia-button>
          </gaia-input-form>
        </gaia-card>
      </neon-animatable>
    </neon-animated-pages>

    <gaia-icon-button id="backButton" icon="arrow-back" disabled="[[disabled]]"
        on-tap="onBack_" hidden>
    </gaia-icon-button>

    <paper-dialog id="forgotPasswordDlg" no-cancel-on-outside-click
        on-iron-overlay-closed="onDialogOverlayClosed_">
      <p i18n-content="offlineLoginForgotPasswordDlg"></p>
      <div class="buttons">
        <gaia-button type="dialog" dialog-confirm autofocus
            i18n-content="offlineLoginCloseBtn">
        </gaia-button>
      </div>
    </paper-dialog>
  </template>
</dom-module>