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

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

Issue 396993003: DevTools: get rid of WebInspector.cssModel, use target models instead (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/main/App.js ('k') | Source/devtools/front_end/profiler/CPUProfileView.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 f3eba3d0b0d1b173d1cce5f258bc815e2c77be51..5027863952ca96353bd4e91408df1fe8d1757bd2 100644
--- a/Source/devtools/front_end/main/Main.js
+++ b/Source/devtools/front_end/main/Main.js
@@ -216,6 +216,7 @@ WebInspector.Main.prototype = {
WebInspector.ContextMenu.initialize();
WebInspector.dockController = new WebInspector.DockController(canDock);
WebInspector.overridesSupport = new WebInspector.OverridesSupport(canDock);
+ WebInspector.multitargetConsoleModel = new WebInspector.MultitargetConsoleModel();
WebInspector.shortcutsScreen = new WebInspector.ShortcutsScreen();
// set order of some sections explicitly
@@ -296,7 +297,6 @@ WebInspector.Main.prototype = {
WebInspector.setToolbarColors(/** @type {string} */ (event.data["backgroundColor"]), /** @type {string} */ (event.data["color"]));
}
WebInspector.ContextMenu.initialize();
-
WebInspector.targetManager.createTarget(WebInspector.UIString("Main"), connection, this._mainTargetCreated.bind(this));
WebInspector.isolatedFileSystemManager = new WebInspector.IsolatedFileSystemManager();
WebInspector.workspace = new WebInspector.Workspace(WebInspector.isolatedFileSystemManager.mapping());
@@ -368,7 +368,7 @@ WebInspector.Main.prototype = {
var errorWarningCount = document.getElementById("error-warning-count");
function showConsole()
{
- WebInspector.consoleModel.show();
+ WebInspector.console.show();
}
errorWarningCount.addEventListener("click", showConsole, false);
@@ -414,7 +414,7 @@ WebInspector.Main.prototype = {
{
var message = /** @type {!WebInspector.Console.Message} */ (event.data);
if (message.show)
- WebInspector.consoleModel.show();
+ WebInspector.console.show();
}
},
@@ -835,33 +835,14 @@ WebInspector.panel = function(name)
/**
* @constructor
- * @implements {WebInspector.TargetManager.Observer}
*/
WebInspector.Main.WarningErrorCounter = function()
{
- WebInspector.targetManager.observeTargets(this);
+ WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._updateErrorAndWarningCounts, this);
+ WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._updateErrorAndWarningCounts, this);
}
WebInspector.Main.WarningErrorCounter.prototype = {
- /**
- * @param {!WebInspector.Target} target
- */
- targetAdded: function(target)
- {
- target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._updateErrorAndWarningCounts, this);
- target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._updateErrorAndWarningCounts, this);
- this._updateErrorAndWarningCounts();
- },
-
- /**
- * @param {!WebInspector.Target} target
- */
- targetRemoved: function(target)
- {
- target.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._updateErrorAndWarningCounts, this);
- target.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._updateErrorAndWarningCounts, this);
- },
-
_updateErrorAndWarningCounts: function()
{
var errors = 0;
« no previous file with comments | « Source/devtools/front_end/main/App.js ('k') | Source/devtools/front_end/profiler/CPUProfileView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698