// Copyright (c) 2012 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 Demo login UI.
 */

/**
 * Handles a user clicking anywhere on the screen. This will log the demo user
 * in. Yes, this actually _is the intention.
 */
onClick = function() {
  chrome.send('launchDemoUser');
};

/**
 * Initializes the click handler.
 */
initialize = function() {
  document.addEventListener('click', onClick);
};

disableTextSelectAndDrag();
document.addEventListener('DOMContentLoaded', initialize);

// Copyright (c) 2012 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 Demo login UI.
 */

/**
 * Handles a user clicking anywhere on the screen. This will log the demo user
 * in. Yes, this actually _is the intention.
 */
onClick = function(e) {
  document.removeEventListener('click', onClick);
  e.stopPropagation();
  chrome.send('launchDemoUser');
};

/**
 * Initializes the click handler.
 */
initialize = function() {
  document.addEventListener('click', onClick);
};

disableTextSelectAndDrag();
document.addEventListener('DOMContentLoaded', initialize);

Fix possible issue with multiple clicks on demo login screen. Though this doesn't currently repro, there is a possibility that if the demo login flow takes too long, a user clicking really fast on the login screen may see unexpected behavior due to multiple login attempts being kicked off. This CL will ensure that that doesn't happen.
Fix possible issue with multiple clicks on demo login screen.
Though this doesn't currently repro, there is a possibility that if the demo login flow takes too long, a user clicking really fast on the login screen may see unexpected behavior due to multiple login attempts being kicked off.
This CL will ensure that that doesn't happen.


R=xiyuan@chromium.org,nkostylev@chromium.org
BUG=None
TEST=Tested that login flow works correctly.


Review URL: http://codereview.chromium.org/9796003

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@128308 0039d316-1c4b-4281-b951-d872f2087c98
