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

Unified Diff: third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js

Issue 1397403003: [DevTools] Remove HelpScreen, turn SettingsScreen into dialog and web component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screens
Patch Set: Created 5 years, 2 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: third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js
diff --git a/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js b/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js
index 6f3a47a7af8615ea65839695435b5869d2e15f75..53dca088bd1df4f0cd70df816a46c5880dca521c 100644
--- a/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js
+++ b/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js
@@ -30,21 +30,20 @@
/**
* @constructor
- * @param {function()} onHide
- * @extends {WebInspector.HelpScreen}
+ * @extends {WebInspector.VBox}
*/
-WebInspector.SettingsScreen = function(onHide)
+WebInspector.SettingsScreen = function()
{
- WebInspector.HelpScreen.call(this);
+ WebInspector.VBox.call(this, true);
+ this.markAsRoot();
yurys 2015/10/13 00:52:11 Drop this.
dgozman 2015/10/13 01:57:42 Done.
+ this.registerRequiredCSS("settings/settingsScreen.css");
this.element.id = "settings-screen";
- /** @type {function()} */
- this._onHide = onHide;
-
- this._contentElement = this.element.createChild("div", "help-window-main");
+ this.contentElement.tabIndex = 0;
+ this.contentElement.classList.add("help-window-main");
+ this.contentElement.classList.add("vbox");
var settingsLabelElement = createElementWithClass("div", "help-window-label");
settingsLabelElement.createTextChild(WebInspector.UIString("Settings"));
- this._contentElement.appendChild(this.createCloseButton());
this._tabbedPane = new WebInspector.TabbedPane();
this._tabbedPane.insertBeforeTabStrip(settingsLabelElement);
@@ -59,6 +58,7 @@ WebInspector.SettingsScreen = function(onHide)
this.element.addEventListener("keydown", this._keyDown.bind(this), false);
this._developerModeCounter = 0;
+ this.setDefaultFocusedElement(this.contentElement);
}
WebInspector.SettingsScreen.prototype = {
@@ -68,8 +68,8 @@ WebInspector.SettingsScreen.prototype = {
wasShown: function()
{
this._tabbedPane.selectTab("general");
- this._tabbedPane.show(this._contentElement);
- WebInspector.HelpScreen.prototype.wasShown.call(this);
+ this._tabbedPane.show(this.contentElement);
+ WebInspector.VBox.prototype.wasShown.call(this);
},
/**
@@ -81,27 +81,6 @@ WebInspector.SettingsScreen.prototype = {
},
/**
- * @override
- * @return {boolean}
- */
- isClosingKey: function(keyCode)
- {
- return [
- WebInspector.KeyboardShortcut.Keys.Enter.code,
- WebInspector.KeyboardShortcut.Keys.Esc.code,
- ].indexOf(keyCode) >= 0;
- },
-
- /**
- * @override
- */
- willHide: function()
- {
- this._onHide();
- WebInspector.HelpScreen.prototype.willHide.call(this);
- },
-
- /**
* @param {!Event} event
*/
_keyDown: function(event)
@@ -111,7 +90,7 @@ WebInspector.SettingsScreen.prototype = {
this.element.classList.add("settings-developer-mode");
},
- __proto__: WebInspector.HelpScreen.prototype
+ __proto__: WebInspector.VBox.prototype
}
/**
@@ -560,36 +539,24 @@ WebInspector.SettingsController = function()
{
/** @type {?WebInspector.SettingsScreen} */
this._settingsScreen;
- this._resizeBound = this._resize.bind(this);
}
WebInspector.SettingsController.prototype = {
- _onHideSettingsScreen: function()
- {
- var window = this._settingsScreen.element.ownerDocument.defaultView;
- window.removeEventListener("resize", this._resizeBound, false);
- delete this._settingsScreenVisible;
- },
-
/**
* @param {string=} name
*/
showSettingsScreen: function(name)
{
if (!this._settingsScreen)
- this._settingsScreen = new WebInspector.SettingsScreen(this._onHideSettingsScreen.bind(this));
- this._settingsScreen.showModal();
+ this._settingsScreen = new WebInspector.SettingsScreen();
+
+ var dialog = new WebInspector.Dialog();
+ dialog.addCloseButton();
+ this._settingsScreen.show(dialog.element);
+ dialog.show();
+
if (name)
this._settingsScreen.selectTab(name);
- this._settingsScreenVisible = true;
- var window = this._settingsScreen.element.ownerDocument.defaultView;
- window.addEventListener("resize", this._resizeBound, false);
- },
-
- _resize: function()
- {
- if (this._settingsScreen && this._settingsScreen.isShowing())
- this._settingsScreen.doResize();
}
}

Powered by Google App Engine
This is Rietveld 408576698