| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegat
e | 7 * @param {function(!WebInspector.LiveLocation)} updateDelegate |
| 8 */ | 8 */ |
| 9 WebInspector.LiveLocation = function(updateDelegate) | 9 WebInspector.LiveLocation = function(updateDelegate) |
| 10 { | 10 { |
| 11 this._updateDelegate = updateDelegate; | 11 this._updateDelegate = updateDelegate; |
| 12 } | 12 } |
| 13 | 13 |
| 14 WebInspector.LiveLocation.prototype = { | 14 WebInspector.LiveLocation.prototype = { |
| 15 update: function() | 15 update: function() |
| 16 { | 16 { |
| 17 var uiLocation = this.uiLocation(); | 17 this._updateDelegate(this); |
| 18 if (!uiLocation) | |
| 19 return; | |
| 20 if (this._updateDelegate(uiLocation)) | |
| 21 this.dispose(); | |
| 22 }, | 18 }, |
| 23 | 19 |
| 24 /** | 20 /** |
| 25 * @return {?WebInspector.UILocation} | 21 * @return {?WebInspector.UILocation} |
| 26 */ | 22 */ |
| 27 uiLocation: function() | 23 uiLocation: function() |
| 28 { | 24 { |
| 29 throw "Not implemented"; | 25 throw "Not implemented"; |
| 30 }, | 26 }, |
| 31 | 27 |
| 32 dispose: function() | 28 dispose: function() |
| 33 { | 29 { |
| 34 // Overridden by subclasses. | 30 // Overridden by subclasses. |
| 31 }, |
| 32 |
| 33 /** |
| 34 * @return {boolean} |
| 35 */ |
| 36 isBlackboxed: function() |
| 37 { |
| 38 throw "Not implemented"; |
| 35 } | 39 } |
| 36 } | 40 } |
| OLD | NEW |