{"size": 1272, "ext": "js", "max_stars_repo_path": "chrome/browser/resources/chromeos/login/oobe_screen_autolaunch.js", "max_stars_repo_name": "Ron423c/chromium", "max_stars_repo_stars_event_min_datetime": "2015-06-18T23:58:20.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-23T09:32:39.000Z", "max_issues_repo_path": "chrome/browser/resources/chromeos/login/oobe_screen_autolaunch.js", "max_issues_repo_name": "Ron423c/chromium", "max_issues_repo_issues_event_min_datetime": "2015-05-04T09:58:14.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-31T19:35:03.000Z", "max_forks_repo_path": "chrome/browser/resources/chromeos/login/oobe_screen_autolaunch.js", "max_forks_repo_name": "Yannic/chromium", "max_forks_repo_forks_event_min_datetime": "2015-07-14T10:40:50.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-15T01:11:49.000Z"}
{"max_stars_count": 575, "max_issues_count": 113, "max_forks_count": 52, "avg_line_length": 20.5161290323, "max_line_length": 77, "alphanum_fraction": 0.6438679245}
// Copyright 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 Oobe reset screen implementation.
 */

Polymer({
  is: 'autolaunch-element',

  behaviors: [OobeI18nBehavior, OobeDialogHostBehavior, LoginScreenBehavior],

  EXTERNAL_API: [
    'updateApp',
  ],

  properties: {
    appName_: {type: String, value: ''},
    appIconUrl_: {type: String, value: ''},
  },


  ready() {
    this.initializeLoginScreen('AutolaunchScreen', {
      resetAllowed: true,
    });
  },

  onConfirm_() {
    chrome.send('autolaunchOnConfirm');
  },

  onCancel_() {
    chrome.send('autolaunchOnCancel');
  },

  /**
   * Event handler invoked when the page is shown and ready.
   */
  onBeforeShow() {
    chrome.send('autolaunchVisible');
  },

  /**
   * Cancels the reset and drops the user back to the login screen.
   */
  cancel() {
    chrome.send('autolaunchOnCancel');
  },

  /**
   * Sets app to be displayed in the auto-launch warning.
   * @param {!Object} app An dictionary with app info.
   */
  updateApp(app) {
    this.appName_ = app.appName;
    if (app.appIconUrl && app.appIconUrl.length)
      this.appIconUrl_ = app.appIconUrl;
  },
});
