Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7050)

Unified Diff: chrome/browser/resources/signin/signin_error/signin_error.js

Issue 2274013002: [Signin Error Dialog] (1/3) Added necessary web components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/signin/signin_error/signin_error.js
diff --git a/chrome/browser/resources/sync_confirmation/sync_confirmation.js b/chrome/browser/resources/signin/signin_error/signin_error.js
similarity index 54%
copy from chrome/browser/resources/sync_confirmation/sync_confirmation.js
copy to chrome/browser/resources/signin/signin_error/signin_error.js
index e22b4ddecc67c1dd4ebc7bdcea9dbb88703c9b5f..d7fe2cc742da98318cb58febac8b504751e36dba 100644
--- a/chrome/browser/resources/sync_confirmation/sync_confirmation.js
+++ b/chrome/browser/resources/signin/signin_error/signin_error.js
@@ -1,47 +1,23 @@
-/* Copyright 2015 The Chromium Authors. All rights reserved.
+/* Copyright 2016 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. */
-cr.define('sync.confirmation', function() {
+cr.define('signin.error', function() {
'use strict';
- function onConfirm(e) {
- chrome.send('confirm');
- }
-
- function onUndo(e) {
- chrome.send('undo');
- }
-
- function onGoToSettings(e) {
- chrome.send('goToSettings');
- }
-
function initialize() {
document.addEventListener('keydown', onKeyDown);
$('confirmButton').addEventListener('click', onConfirm);
- $('undoButton').addEventListener('click', onUndo);
- $('settingsLink').addEventListener('click', onGoToSettings);
- $('profile-picture').addEventListener('load', onPictureLoaded);
+ $('closeButton').addEventListener('click', onConfirm);
+ $('switchButton').addEventListener('click', onSwitchToExistingProfile);
+ $('learnMoreLink').addEventListener('click', onLearnMore);
chrome.send('initializedWithSize', [document.body.scrollHeight]);
}
- function clearFocus() {
- document.activeElement.blur();
- }
-
- function setUserImageURL(url) {
- $('profile-picture').src = url;
- }
-
- function onPictureLoaded(e) {
- $('picture-container').classList.add('loaded');
- }
-
function onKeyDown(e) {
// If the currently focused element isn't something that performs an action
// on "enter" being pressed and the user hits "enter", perform the default
- // action of the dialog, which is "OK, Got It".
+ // action of the dialog, which is "OK".
if (e.key == 'Enter' &&
!/^(A|PAPER-BUTTON)$/.test(document.activeElement.tagName)) {
$('confirmButton').click();
@@ -49,11 +25,33 @@ cr.define('sync.confirmation', function() {
}
}
+ function onConfirm(e) {
+ chrome.send('confirm');
+ }
+
+ function onSwitchToExistingProfile(e) {
+ chrome.send('switchToExistingProfile');
+ }
+
+ function onLearnMore(e) {
+ chrome.send('learnMore');
+ }
+
+ function clearFocus() {
+ document.activeElement.blur();
+ }
+
+ function removeSwitchButton() {
+ $('switchButton').style.display = 'none';
+ $('closeButton').style.display = 'none';
+ $('confirmButton').style.display = '';
Dan Beam 2016/08/30 00:43:08 can you use hidden = true/false instead of .style.
+ }
+
return {
- clearFocus: clearFocus,
initialize: initialize,
- setUserImageURL: setUserImageURL
+ clearFocus: clearFocus,
+ removeSwitchButton: removeSwitchButton
};
});
-document.addEventListener('DOMContentLoaded', sync.confirmation.initialize);
+document.addEventListener('DOMContentLoaded', signin.error.initialize);

Powered by Google App Engine
This is Rietveld 408576698