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

Side by Side Diff: Source/devtools/front_end/sdk/StylesSourceMapping.js

Issue 299393007: DevTools: Remove MainFrameCreatedOrNavigated event. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « Source/devtools/front_end/sdk/ResourceTreeModel.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24 matching lines...) Expand all
35 * @param {!WebInspector.Workspace} workspace 35 * @param {!WebInspector.Workspace} workspace
36 */ 36 */
37 WebInspector.StylesSourceMapping = function(cssModel, workspace) 37 WebInspector.StylesSourceMapping = function(cssModel, workspace)
38 { 38 {
39 this._cssModel = cssModel; 39 this._cssModel = cssModel;
40 this._workspace = workspace; 40 this._workspace = workspace;
41 this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectWillRe set, this._projectWillReset, this); 41 this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectWillRe set, this._projectWillReset, this);
42 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeA dded, this._uiSourceCodeAddedToWorkspace, this); 42 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeA dded, this._uiSourceCodeAddedToWorkspace, this);
43 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeR emoved, this._uiSourceCodeRemoved, this); 43 this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeR emoved, this._uiSourceCodeRemoved, this);
44 44
45 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.MainFrameCreatedOrNavigated, this._mainFrameCreatedOrNavigated, th is); 45 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
46 46
47 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheet Changed, this._styleSheetChanged, this); 47 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheet Changed, this._styleSheetChanged, this);
48 this._initialize(); 48 this._initialize();
49 } 49 }
50 50
51 WebInspector.StylesSourceMapping.MinorChangeUpdateTimeoutMs = 1000; 51 WebInspector.StylesSourceMapping.MinorChangeUpdateTimeoutMs = 1000;
52 52
53 WebInspector.StylesSourceMapping.prototype = { 53 WebInspector.StylesSourceMapping.prototype = {
54 /** 54 /**
55 * @param {!WebInspector.RawLocation} rawLocation 55 * @param {!WebInspector.RawLocation} rawLocation
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 { 204 {
205 /** @type {!Object.<string, !StringMap.<!StringMap.<!WebInspector.CSSSty leSheetHeader>>>} */ 205 /** @type {!Object.<string, !StringMap.<!StringMap.<!WebInspector.CSSSty leSheetHeader>>>} */
206 this._urlToHeadersByFrameId = {}; 206 this._urlToHeadersByFrameId = {};
207 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.StyleFile>} * / 207 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.StyleFile>} * /
208 this._styleFiles = new Map(); 208 this._styleFiles = new Map();
209 }, 209 },
210 210
211 /** 211 /**
212 * @param {!WebInspector.Event} event 212 * @param {!WebInspector.Event} event
213 */ 213 */
214 _mainFrameCreatedOrNavigated: function(event) 214 _mainFrameNavigated: function(event)
215 { 215 {
216 for (var url in this._urlToHeadersByFrameId) { 216 for (var url in this._urlToHeadersByFrameId) {
217 var uiSourceCode = this._workspace.uiSourceCodeForURL(url); 217 var uiSourceCode = this._workspace.uiSourceCodeForURL(url);
218 if (!uiSourceCode) 218 if (!uiSourceCode)
219 continue; 219 continue;
220 this._unbindUISourceCode(uiSourceCode); 220 this._unbindUISourceCode(uiSourceCode);
221 } 221 }
222 this._initialize(); 222 this._initialize();
223 }, 223 },
224 224
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 this._uiSourceCode.addRevision(content); 420 this._uiSourceCode.addRevision(content);
421 delete this._isAddingRevision; 421 delete this._isAddingRevision;
422 }, 422 },
423 423
424 dispose: function() 424 dispose: function()
425 { 425 {
426 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this); 426 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this);
427 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this); 427 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this);
428 } 428 }
429 } 429 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/ResourceTreeModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698