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

Side by Side Diff: chrome/browser/resources/shared/js/cr/ui/dialogs.js

Issue 9594024: Fixed bug making it impossible to opt-out of auto-enrollment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comment Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('cr.ui.dialogs', function() { 5 cr.define('cr.ui.dialogs', function() {
6 6
7 function BaseDialog(parentNode) { 7 function BaseDialog(parentNode) {
8 this.parentNode_ = parentNode; 8 this.parentNode_ = parentNode;
9 this.document_ = parentNode.ownerDocument; 9 this.document_ = parentNode.ownerDocument;
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 this.show_(title, onOk, onCancel, onShow); 117 this.show_(title, onOk, onCancel, onShow);
118 }; 118 };
119 119
120 BaseDialog.prototype.findFocusableElements_ = function(doc) { 120 BaseDialog.prototype.findFocusableElements_ = function(doc) {
121 var elements = Array.prototype.filter.call( 121 var elements = Array.prototype.filter.call(
122 doc.querySelectorAll('*'), 122 doc.querySelectorAll('*'),
123 function(n) { return n.tabIndex >= 0; }); 123 function(n) { return n.tabIndex >= 0; });
124 124
125 var iframes = doc.querySelectorAll('iframe'); 125 var iframes = doc.querySelectorAll('iframe');
126 for (var i = 0; i < iframes.length; i++) { 126 for (var i = 0; i < iframes.length; i++) {
127 elements = elements.concat(this.findFocusableElements_( 127 // Some iframes have an undefined contentDocument for security reasons,
128 iframes[i].contentDocument)); 128 // such as chrome://terms (which is used in the chromeos OOBE screens).
129 var contentDoc = iframes[i].contentDocument;
130 if (contentDoc)
131 elements = elements.concat(this.findFocusableElements_(contentDoc));
129 } 132 }
130 return elements; 133 return elements;
131 }; 134 };
132 135
133 BaseDialog.prototype.showWithTitle = function(title, message, 136 BaseDialog.prototype.showWithTitle = function(title, message,
134 onOk, onCancel, onShow) { 137 onOk, onCancel, onShow) {
135 this.text_.textContent = message; 138 this.text_.textContent = message;
136 this.show_(title, onOk, onCancel, onShow); 139 this.show_(title, onOk, onCancel, onShow);
137 }; 140 };
138 141
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 this.onOk_(this.getValue()); 286 this.onOk_(this.getValue());
284 }; 287 };
285 288
286 return { 289 return {
287 BaseDialog: BaseDialog, 290 BaseDialog: BaseDialog,
288 AlertDialog: AlertDialog, 291 AlertDialog: AlertDialog,
289 ConfirmDialog: ConfirmDialog, 292 ConfirmDialog: ConfirmDialog,
290 PromptDialog: PromptDialog 293 PromptDialog: PromptDialog
291 }; 294 };
292 }); 295 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698