Changeset 82814 in webkit


Ignore:
Timestamp:
Apr 4, 2011 3:10:29 AM (13 years ago)
Author:
caseq@chromium.org
Message:

2011-04-04 Andrey Kosyakov <caseq@chromium.org>

Unreviewed. Followup to an incomplete commit in r82806.

  • inspector/front-end/ExtensionAPI.js: (WebInspector.injectedExtensionAPI.PanelWithSidebarImpl.prototype.createSidebarPane): (WebInspector.injectedExtensionAPI.ExtensionSidebarPaneImpl): (WebInspector.injectedExtensionAPI.ExtensionSidebarPaneImpl.prototype.setHeight): (WebInspector.injectedExtensionAPI.ExtensionSidebarPaneImpl.prototype.setExpression): (WebInspector.injectedExtensionAPI):
  • inspector/front-end/ExtensionPanel.js: (WebInspector.ExtensionSidebarPane): (WebInspector.ExtensionSidebarPane.prototype.setPage): (WebInspector.ExtensionSidebarPane.prototype._setObject):
  • inspector/front-end/ExtensionServer.js: (WebInspector.ExtensionServer): (WebInspector.ExtensionServer.prototype.notifyExtensionSidebarUpdated): (WebInspector.ExtensionServer.prototype._onCreatePanel): (WebInspector.ExtensionServer.prototype._onCreateSidebarPane): (WebInspector.ExtensionServer.prototype.createClientIframe): (WebInspector.ExtensionServer.prototype._onSetSidebarContent):

2011-04-04 Andrey Kosyakov <caseq@chromium.org>

Unreviewed. Followup to an incomplete commit in r82806.

  • inspector/extensions/extensions.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r82813 r82814  
     12011-04-04  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Unreviewed. Followup to an incomplete commit in r82806.
     4
     5        * inspector/extensions/extensions.html:
     6
    172011-04-04  Pavel Podivilov  <podivilov@chromium.org>
    28
  • trunk/LayoutTests/inspector/extensions/extensions.html

    r82806 r82814  
    1616}
    1717
    18 function extension_testCreateSidebar(nextTest)
     18function extension_testSidebarPage(nextTest)
    1919{
    2020    function onSidebarCreated(sidebar)
     
    2222        output("Sidebar created");
    2323        dumpObject(sidebar);
     24        sidebar.onUpdated.addListener(nextTest);
     25        sidebar.setPage("extension-sidebar.html");
    2426    }
    2527    webInspector.panels.elements.createSidebarPane("Test Sidebar", onSidebarCreated);
     
    3133}
    3234
    33 function extension_testExtensionWatchSidebarObject(nextTest)
     35function extension_testSidebarWatchObject(nextTest)
    3436{
    3537    function onSidebarCreated(sidebar)
     
    4951        });
    5052    }
    51     webInspector.panels.elements.createWatchExpressionSidebarPane("Watch Test: Object", onSidebarCreated);
     53    webInspector.panels.elements.createSidebarPane("Watch Test: Object", onSidebarCreated);
    5254}
    5355
    54 function extension_testExtensionWatchSidebarExpression(nextTest)
     56function extension_testSidebarWatchExpression(nextTest)
    5557{
    5658    function onSidebarCreated(sidebar)
     
    7577        sidebar.setExpression("(" + expression.toString() + ")();", "title");
    7678    }
    77     webInspector.panels.elements.createWatchExpressionSidebarPane("Watch Test: Expression", onSidebarCreated);
     79    webInspector.panels.elements.createSidebarPane("Watch Test: Expression", onSidebarCreated);
    7880}
    7981
  • trunk/Source/WebCore/ChangeLog

    r82811 r82814  
     12011-04-04  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Unreviewed. Followup to an incomplete commit in r82806.
     4
     5        * inspector/front-end/ExtensionAPI.js:
     6        (WebInspector.injectedExtensionAPI.PanelWithSidebarImpl.prototype.createSidebarPane):
     7        (WebInspector.injectedExtensionAPI.ExtensionSidebarPaneImpl):
     8        (WebInspector.injectedExtensionAPI.ExtensionSidebarPaneImpl.prototype.setHeight):
     9        (WebInspector.injectedExtensionAPI.ExtensionSidebarPaneImpl.prototype.setExpression):
     10        (WebInspector.injectedExtensionAPI):
     11        * inspector/front-end/ExtensionPanel.js:
     12        (WebInspector.ExtensionSidebarPane):
     13        (WebInspector.ExtensionSidebarPane.prototype.setPage):
     14        (WebInspector.ExtensionSidebarPane.prototype._setObject):
     15        * inspector/front-end/ExtensionServer.js:
     16        (WebInspector.ExtensionServer):
     17        (WebInspector.ExtensionServer.prototype.notifyExtensionSidebarUpdated):
     18        (WebInspector.ExtensionServer.prototype._onCreatePanel):
     19        (WebInspector.ExtensionServer.prototype._onCreateSidebarPane):
     20        (WebInspector.ExtensionServer.prototype.createClientIframe):
     21        (WebInspector.ExtensionServer.prototype._onSetSidebarContent):
     22
    1232011-04-04  Yury Semikhatsky  <yurys@chromium.org>
    224
  • trunk/Source/WebCore/inspector/front-end/ExtensionAPI.js

    r82806 r82814  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2011 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    191191
    192192PanelWithSidebarImpl.prototype = {
    193     createSidebarPane: function(title, url, callback)
     193    createSidebarPane: function(title, callback)
    194194    {
    195195        var id = "extension-sidebar-" + extensionServer.nextObjectId();
     
    205205        }
    206206        extensionServer.sendRequest(request, callback && callbackWrapper);
    207     },
    208 
    209     createWatchExpressionSidebarPane: function(title, callback)
    210     {
    211         var id = "watch-sidebar-" + extensionServer.nextObjectId();
    212         var request = {
    213             command: "createWatchExpressionSidebarPane",
    214             panel: this._id,
    215             id: id,
    216             title: title
    217         };
    218         function callbackWrapper()
    219         {
    220             callback(new WatchExpressionSidebarPane(id));
    221         }
    222         extensionServer.sendRequest(request, callback && callbackWrapper);
    223207    }
    224208}
     
    242226{
    243227    this._id = id;
     228    this.onUpdated = new EventSink("sidebar-updated-" + id);
    244229}
    245230
     
    248233    {
    249234        extensionServer.sendRequest({ command: "setSidebarHeight", id: this._id, height: height });
    250     }
    251 }
    252 
    253 function WatchExpressionSidebarPaneImpl(id)
    254 {
    255     ExtensionSidebarPaneImpl.call(this, id);
    256     this.onUpdated = new EventSink("watch-sidebar-updated-" + id);
    257 }
    258 
    259 WatchExpressionSidebarPaneImpl.prototype = {
     235    },
     236
    260237    setExpression: function(expression, rootTitle)
    261238    {
    262         extensionServer.sendRequest({ command: "setWatchSidebarContent", id: this._id, expression: expression, rootTitle: rootTitle, evaluateOnPage: true });
     239        extensionServer.sendRequest({ command: "setSidebarContent", id: this._id, expression: expression, rootTitle: rootTitle, evaluateOnPage: true });
    263240    },
    264241
     
    272249        extensionServer.sendRequest({ command: "setSidebarPage", id: this._id, url: expandURL(url) });
    273250    }
    274 }
    275 
    276 WatchExpressionSidebarPaneImpl.prototype.__proto__ = ExtensionSidebarPaneImpl.prototype;
    277 
    278 function WatchExpressionSidebarPane(id)
    279 {
    280     var impl = new WatchExpressionSidebarPaneImpl(id);
    281     ExtensionSidebarPane.call(this, id, impl);
    282251}
    283252
     
    516485var PanelWithSidebar = declareInterfaceClass(PanelWithSidebarImpl);
    517486var Resource = declareInterfaceClass(ResourceImpl);
    518 var WatchExpressionSidebarPane = declareInterfaceClass(WatchExpressionSidebarPaneImpl);
    519487
    520488var extensionServer = new ExtensionServerClient();
  • trunk/Source/WebCore/inspector/front-end/ExtensionPanel.js

    r80845 r82814  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2011 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    8282WebInspector.ExtensionPanel.prototype.__proto__ = WebInspector.Panel.prototype;
    8383
    84 WebInspector.ExtensionWatchSidebarPane = function(title, id)
     84WebInspector.ExtensionSidebarPane = function(title, id)
    8585{
    8686    WebInspector.SidebarPane.call(this, title);
     
    8888}
    8989
    90 WebInspector.ExtensionWatchSidebarPane.prototype = {
     90WebInspector.ExtensionSidebarPane.prototype = {
    9191    setObject: function(object, title)
    9292    {
     
    9797    {
    9898        RuntimeAgent.evaluate(expression, "extension-watch", false, this._onEvaluate.bind(this, title));
     99    },
     100
     101    setPage: function(url)
     102    {
     103        this.bodyElement.removeChildren();
     104        WebInspector.extensionServer.createClientIframe(this.bodyElement, url);
     105        // TODO: Consider doing this upon load event.
     106        WebInspector.extensionServer.notifyExtensionSidebarUpdated(this._id);
    99107    },
    100108
     
    113121        section.expanded = true;
    114122        this.bodyElement.appendChild(section.element);
    115         WebInspector.extensionServer.notifyExtensionWatchSidebarUpdated(this._id);
     123        WebInspector.extensionServer.notifyExtensionSidebarUpdated(this._id);
    116124    }
    117125}
    118126
    119 WebInspector.ExtensionWatchSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
     127WebInspector.ExtensionSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
  • trunk/Source/WebCore/inspector/front-end/ExtensionServer.js

    r82806 r82814  
    4343    this._registerHandler("addAuditResult", this._onAddAuditResult.bind(this));
    4444    this._registerHandler("createPanel", this._onCreatePanel.bind(this));
    45     this._registerHandler("createSidebarPane", this._onCreateSidebar.bind(this));
    46     this._registerHandler("createWatchExpressionSidebarPane", this._onCreateWatchExpressionSidebarPane.bind(this));
     45    this._registerHandler("createSidebarPane", this._onCreateSidebarPane.bind(this));
    4746    this._registerHandler("evaluateOnInspectedPage", this._onEvaluateOnInspectedPage.bind(this));
    4847    this._registerHandler("getHAR", this._onGetHAR.bind(this));
     
    5150    this._registerHandler("reload", this._onReload.bind(this));
    5251    this._registerHandler("setSidebarHeight", this._onSetSidebarHeight.bind(this));
    53     this._registerHandler("setWatchSidebarContent", this._onSetWatchSidebarContent.bind(this));
     52    this._registerHandler("setSidebarContent", this._onSetSidebarContent.bind(this));
     53    this._registerHandler("setSidebarPage", this._onSetSidebarPage.bind(this));
    5454    this._registerHandler("stopAuditCategoryRun", this._onStopAuditCategoryRun.bind(this));
    5555    this._registerHandler("subscribe", this._onSubscribe.bind(this));
     
    9595    },
    9696
    97     notifyExtensionWatchSidebarUpdated: function(id)
    98     {
    99         this._postNotification("watch-sidebar-updated-" + id);
     97    notifyExtensionSidebarUpdated: function(id)
     98    {
     99        this._postNotification("sidebar-updated-" + id);
    100100    },
    101101
     
    196196        WebInspector.addPanel(panel);
    197197
    198         var iframe = this._createClientIframe(panel.element, message.url);
     198        var iframe = this.createClientIframe(panel.element, message.url);
    199199        iframe.style.height = "100%";
    200200        return this._status.OK();
    201201    },
    202202
    203     _onCreateSidebar: function(message)
    204     {
    205         var sidebar = this._createSidebar(message, WebInspector.SidebarPane);
    206         if (sidebar.isError)
    207             return sidebar;
    208         this._createClientIframe(sidebar.bodyElement, message.url);
    209         return this._status.OK();
    210     },
    211 
    212     _onCreateWatchExpressionSidebarPane: function(message)
    213     {
    214         var sidebar = this._createSidebar(message, WebInspector.ExtensionWatchSidebarPane);
    215         return sidebar.isError ? sidebar : this._status.OK();
    216     },
    217 
    218     _createSidebar: function(message, constructor)
     203    _onCreateSidebarPane: function(message, constructor)
    219204    {
    220205        var panel = WebInspector.panels[message.panel];
     
    224209            return this._status.E_NOTSUPPORTED();
    225210        var id = message.id;
    226         var sidebar = new constructor(message.title, message.id);
     211        var sidebar = new WebInspector.ExtensionSidebarPane(message.title, message.id);
    227212        this._clientObjects[id] = sidebar;
    228213        panel.sidebarPanes[id] = sidebar;
    229214        panel.sidebarElement.appendChild(sidebar.element);
    230215
    231         return sidebar;
    232     },
    233 
    234     _createClientIframe: function(parent, url, requestId, port)
     216        return this._status.OK();
     217    },
     218
     219    createClientIframe: function(parent, url)
    235220    {
    236221        var iframe = document.createElement("iframe");
     
    249234    },
    250235
    251     _onSetWatchSidebarContent: function(message)
     236    _onSetSidebarContent: function(message)
    252237    {
    253238        var sidebar = this._clientObjects[message.id];
Note: See TracChangeset for help on using the changeset viewer.