summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/chromeos/login/screen_wrong_hwid.js
blob: 202c494275b0e8510cb317cfc68b05b2ec4dadf6 (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
// Copyright (c) 2013 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.

/**
 * @fileoverview wrong HWID screen implementation.
 */

login.createScreen('WrongHWIDScreen', 'wrong-hwid', function() {
  return {
    /** @override */
    decorate: function() {
      $('skip-hwid-warning-link').addEventListener('click', function(event) {
        chrome.send('wrongHWIDOnSkip');
      });
      this.updateLocalizedContent();
    },

    /**
     * Updates state of login header so that necessary buttons are displayed.
     **/
    onBeforeShow: function(data) {
      $('login-header-bar').signinUIState = SIGNIN_UI_STATE.WRONG_HWID_WARNING;
    },

    /**
     * Updates localized content of the screen that is not updated via template.
     */
    updateLocalizedContent: function() {
      $('wrong-hwid-message-content').innerHTML =
          '<p>' +
          loadTimeData.getStringF('wrongHWIDMessageFirstPart',
              '<strong>', '</strong>') +
          '</p><p>' +
          loadTimeData.getString('wrongHWIDMessageSecondPart') +
          '</p>';
    }
  };
});