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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/Dialog.js

Issue 2094873002: DevTools: fix deepActiveElement and focus on Dialog when document blurs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-added buttons as default elements and fix deepActiveElement and dialog focus Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 this.contentElement.addEventListener("focus", this._onFocus.bind(this), fals e); 43 this.contentElement.addEventListener("focus", this._onFocus.bind(this), fals e);
44 this.contentElement.addEventListener("keydown", this._onKeyDown.bind(this), false); 44 this.contentElement.addEventListener("keydown", this._onKeyDown.bind(this), false);
45 45
46 this._wrapsContent = false; 46 this._wrapsContent = false;
47 this._dimmed = false; 47 this._dimmed = false;
48 /** @type {!Map<!HTMLElement, number>} */ 48 /** @type {!Map<!HTMLElement, number>} */
49 this._tabIndexMap = new Map(); 49 this._tabIndexMap = new Map();
50 } 50 }
51 51
52 /** 52 /**
53 * TODO(dgozman): remove this method (it's only used for shortcuts handling).
54 * @return {boolean} 53 * @return {boolean}
55 */ 54 */
56 WebInspector.Dialog.hasInstance = function() 55 WebInspector.Dialog.hasInstance = function()
57 { 56 {
58 return !!WebInspector.Dialog._instance; 57 return !!WebInspector.Dialog._instance;
59 } 58 }
60 59
60 WebInspector.Dialog.focus = function()
61 {
62 if (WebInspector.Dialog._instance)
63 WebInspector.Dialog._instance.focus();
64 }
65
61 WebInspector.Dialog.prototype = { 66 WebInspector.Dialog.prototype = {
62 /** 67 /**
63 * @override 68 * @override
64 */ 69 */
65 show: function() 70 show: function()
66 { 71 {
67 if (WebInspector.Dialog._instance) 72 if (WebInspector.Dialog._instance)
68 WebInspector.Dialog._instance.detach(); 73 WebInspector.Dialog._instance.detach();
69 WebInspector.Dialog._instance = this; 74 WebInspector.Dialog._instance = this;
70 75
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 { 285 {
281 return WebInspector.Dialog._modalHostView; 286 return WebInspector.Dialog._modalHostView;
282 }; 287 };
283 288
284 WebInspector.Dialog.modalHostRepositioned = function() 289 WebInspector.Dialog.modalHostRepositioned = function()
285 { 290 {
286 if (WebInspector.Dialog._instance) 291 if (WebInspector.Dialog._instance)
287 WebInspector.Dialog._instance._position(); 292 WebInspector.Dialog._instance._position();
288 }; 293 };
289 294
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698