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

Unified Diff: Source/devtools/front_end/main/Main.js

Issue 663083004: [DevTools] Remove remaining usages of global properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed review comments Created 6 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
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TracingTimelineUIUtils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/main/Main.js
diff --git a/Source/devtools/front_end/main/Main.js b/Source/devtools/front_end/main/Main.js
index 8b168bcd0c2aa1f3885129c4e9ec293acf47c9bb..40ef835229470a25aa257b26c6558a5d799ef6a0 100644
--- a/Source/devtools/front_end/main/Main.js
+++ b/Source/devtools/front_end/main/Main.js
@@ -129,7 +129,6 @@ WebInspector.Main.prototype = {
{
console.timeStamp("Main._loaded");
- WebInspector.initializeUIUtils();
this._createSettings();
this._createAppUI();
},
@@ -182,26 +181,32 @@ WebInspector.Main.prototype = {
}
},
+ /**
+ * @private // FIXME: this is a workaround for validator bug (http://crbug.com/425506).
+ * @suppressGlobalPropertiesCheck
+ */
_createAppUI: function()
{
console.timeStamp("Main._createApp");
- WebInspector.installPortStyles();
+ WebInspector.initializeUIUtils(window);
+ WebInspector.installPortStyles(document);
if (Runtime.queryParam("toolbarColor") && Runtime.queryParam("textColor"))
- WebInspector.setToolbarColors(Runtime.queryParam("toolbarColor"), Runtime.queryParam("textColor"));
+ WebInspector.setToolbarColors(document, /** @type {string} */ (Runtime.queryParam("toolbarColor")), /** @type {string} */ (Runtime.queryParam("textColor")));
InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.SetToolbarColors, updateToolbarColors);
/**
* @param {!WebInspector.Event} event
+ * @suppressGlobalPropertiesCheck
*/
function updateToolbarColors(event)
{
- WebInspector.setToolbarColors(/** @type {string} */ (event.data["backgroundColor"]), /** @type {string} */ (event.data["color"]));
+ WebInspector.setToolbarColors(document, /** @type {string} */ (event.data["backgroundColor"]), /** @type {string} */ (event.data["color"]));
}
- this._addMainEventListeners();
+ this._addMainEventListeners(document);
var canDock = !!Runtime.queryParam("can_dock");
- WebInspector.zoomManager = new WebInspector.ZoomManager(InspectorFrontendHost);
+ WebInspector.zoomManager = new WebInspector.ZoomManager(window, InspectorFrontendHost);
WebInspector.inspectorView = new WebInspector.InspectorView();
WebInspector.ContextMenu.initialize();
WebInspector.ContextMenu.installHandler(document);
@@ -242,7 +247,7 @@ WebInspector.Main.prototype = {
WebInspector.domBreakpointsSidebarPane = new WebInspector.DOMBreakpointsSidebarPane();
WebInspector.actionRegistry = new WebInspector.ActionRegistry();
- WebInspector.shortcutRegistry = new WebInspector.ShortcutRegistry(WebInspector.actionRegistry);
+ WebInspector.shortcutRegistry = new WebInspector.ShortcutRegistry(WebInspector.actionRegistry, document);
WebInspector.ShortcutsScreen.registerShortcuts();
this._registerForwardedShortcuts();
this._registerMessageSinkListener();
@@ -538,10 +543,9 @@ WebInspector.Main.prototype = {
},
/**
- * @private // FIXME: this is a workaround for validator bug (crbug.com/425506).
- * @suppressGlobalPropertiesCheck
+ * @param {!Document} document
*/
- _addMainEventListeners: function()
+ _addMainEventListeners: function(document)
{
document.addEventListener("keydown", this._postDocumentKeyDown.bind(this), false);
document.addEventListener("beforecopy", this._documentCanCopy.bind(this), true);
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TracingTimelineUIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698