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

Side by Side Diff: Source/devtools/front_end/extensions/ExtensionView.js

Issue 1113813002: [DevTools] Rename View to Widget. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 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 | Annotate | Revision Log
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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @extends {WebInspector.View} 33 * @extends {WebInspector.Widget}
34 * @param {!WebInspector.ExtensionServer} server 34 * @param {!WebInspector.ExtensionServer} server
35 * @param {string} id 35 * @param {string} id
36 * @param {string} src 36 * @param {string} src
37 * @param {string} className 37 * @param {string} className
38 */ 38 */
39 WebInspector.ExtensionView = function(server, id, src, className) 39 WebInspector.ExtensionView = function(server, id, src, className)
40 { 40 {
41 WebInspector.View.call(this); 41 WebInspector.Widget.call(this);
42 this.element.className = "flex-auto fill"; // Override 42 this.element.className = "flex-auto fill"; // Override
43 43
44 this._server = server; 44 this._server = server;
45 this._id = id; 45 this._id = id;
46 this._iframe = createElement("iframe"); 46 this._iframe = createElement("iframe");
47 this._iframe.addEventListener("load", this._onLoad.bind(this), false); 47 this._iframe.addEventListener("load", this._onLoad.bind(this), false);
48 this._iframe.src = src; 48 this._iframe.src = src;
49 this._iframe.className = className; 49 this._iframe.className = className;
50 this.setDefaultFocusedElement(this._iframe); 50 this.setDefaultFocusedElement(this._iframe);
51 51
(...skipping 14 matching lines...) Expand all
66 }, 66 },
67 67
68 _onLoad: function() 68 _onLoad: function()
69 { 69 {
70 var frames = /** @type {!Array.<!Window>} */ (window.frames); 70 var frames = /** @type {!Array.<!Window>} */ (window.frames);
71 this._frameIndex = Array.prototype.indexOf.call(frames, this._iframe.con tentWindow); 71 this._frameIndex = Array.prototype.indexOf.call(frames, this._iframe.con tentWindow);
72 if (this.isShowing()) 72 if (this.isShowing())
73 this._server.notifyViewShown(this._id, this._frameIndex); 73 this._server.notifyViewShown(this._id, this._frameIndex);
74 }, 74 },
75 75
76 __proto__: WebInspector.View.prototype 76 __proto__: WebInspector.Widget.prototype
77 } 77 }
78 78
79 /** 79 /**
80 * @constructor 80 * @constructor
81 * @extends {WebInspector.VBox} 81 * @extends {WebInspector.VBox}
82 * @param {!WebInspector.ExtensionServer} server 82 * @param {!WebInspector.ExtensionServer} server
83 * @param {string} id 83 * @param {string} id
84 */ 84 */
85 WebInspector.ExtensionNotifierView = function(server, id) 85 WebInspector.ExtensionNotifierView = function(server, id)
86 { 86 {
87 WebInspector.VBox.call(this); 87 WebInspector.VBox.call(this);
88 88
89 this._server = server; 89 this._server = server;
90 this._id = id; 90 this._id = id;
91 } 91 }
92 92
93 WebInspector.ExtensionNotifierView.prototype = { 93 WebInspector.ExtensionNotifierView.prototype = {
94 wasShown: function() 94 wasShown: function()
95 { 95 {
96 this._server.notifyViewShown(this._id); 96 this._server.notifyViewShown(this._id);
97 }, 97 },
98 98
99 willHide: function() 99 willHide: function()
100 { 100 {
101 this._server.notifyViewHidden(this._id); 101 this._server.notifyViewHidden(this._id);
102 }, 102 },
103 103
104 __proto__: WebInspector.VBox.prototype 104 __proto__: WebInspector.VBox.prototype
105 } 105 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/extensions/ExtensionPanel.js ('k') | Source/devtools/front_end/inspectorCommon.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698