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

Unified Diff: Source/devtools/front_end/ui/Dialog.js

Issue 1321683003: DevTools: Introduce timeline recording info dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressing comments Created 5 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
« no previous file with comments | « Source/devtools/front_end/timeline/timelineStatusDialog.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/Dialog.js
diff --git a/Source/devtools/front_end/ui/Dialog.js b/Source/devtools/front_end/ui/Dialog.js
index a7ddbdcf7e375c972368df1f4b681d0672babbe6..211f834c603835974a9464a15135157209a29753 100644
--- a/Source/devtools/front_end/ui/Dialog.js
+++ b/Source/devtools/front_end/ui/Dialog.js
@@ -32,11 +32,13 @@
* @constructor
* @param {!Element} relativeToElement
* @param {!WebInspector.DialogDelegate} delegate
+ * @param {boolean=} modal
*/
-WebInspector.Dialog = function(relativeToElement, delegate)
+WebInspector.Dialog = function(relativeToElement, delegate, modal)
{
this._delegate = delegate;
this._relativeToElement = relativeToElement;
+ this._modal = modal;
this._glassPane = new WebInspector.GlassPane(/** @type {!Document} */ (relativeToElement.ownerDocument));
WebInspector.GlassPane.DefaultFocusedViewStack.push(this);
@@ -71,12 +73,14 @@ WebInspector.Dialog.currentInstance = function()
/**
* @param {?Element} relativeToElement
* @param {!WebInspector.DialogDelegate} delegate
+ * @param {boolean=} modal
*/
-WebInspector.Dialog.show = function(relativeToElement, delegate)
+WebInspector.Dialog.show = function(relativeToElement, delegate, modal)
{
if (WebInspector.Dialog._instance)
return;
- WebInspector.Dialog._instance = new WebInspector.Dialog(relativeToElement || WebInspector.Dialog.modalHostView().element, delegate);
+ WebInspector.Dialog._instance = new WebInspector.Dialog(relativeToElement || WebInspector.Dialog.modalHostView().element, delegate, modal);
+ WebInspector.Dialog._instance.focus();
}
WebInspector.Dialog.hide = function()
@@ -105,8 +109,13 @@ WebInspector.Dialog.prototype = {
this._glassPane.dispose();
},
+ /**
+ * @param {!Event} event
+ */
_onGlassPaneFocus: function(event)
{
+ if (this._modal)
+ return;
this._hide();
},
@@ -130,6 +139,8 @@ WebInspector.Dialog.prototype = {
if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code)
this._delegate.onEnter(event);
+ this._delegate.onKeyDown(event);
+
if (!event.handled && this._closeKeys.indexOf(event.keyCode) >= 0) {
this._hide();
event.consume(true);
@@ -178,8 +189,16 @@ WebInspector.DialogDelegate.prototype = {
focus: function() { },
+ /**
+ * @param {!KeyboardEvent} event
+ */
onEnter: function(event) { },
+ /**
+ * @param {!KeyboardEvent} event
+ */
+ onKeyDown: function(event) { },
+
willHide: function() { },
__proto__: WebInspector.Object.prototype
« no previous file with comments | « Source/devtools/front_end/timeline/timelineStatusDialog.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698