diff options
Diffstat (limited to 'Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm')
-rw-r--r-- | Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm index d5a1d95..9b0c893 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm @@ -65,6 +65,7 @@ using namespace WebCore; - (BOOL)attached; - (void)setFrontendClient:(WebInspectorFrontendClient*)frontendClient; - (void)setInspectorClient:(WebInspectorClient*)inspectorClient; +- (WebInspectorClient*)inspectorClient; - (void)setAttachedWindowHeight:(unsigned)height; - (void)destroyInspectorView:(bool)notifyInspectorController; @end @@ -102,10 +103,10 @@ void WebInspectorClient::openInspectorFrontend(InspectorController* inspectorCon [windowController.get() setInspectorClient:this]; m_frontendPage = core([windowController.get() webView]); - WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage, createFrontendSettings()); - m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient); - - [[m_webView inspector] setFrontend:[[WebInspectorFrontend alloc] initWithFrontendClient:frontendClient]]; + OwnPtr<WebInspectorFrontendClient> frontendClient = adoptPtr(new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage, createFrontendSettings())); + RetainPtr<WebInspectorFrontend> webInspectorFrontend(AdoptNS, [[WebInspectorFrontend alloc] initWithFrontendClient:frontendClient.get()]); + [[m_webView inspector] setFrontend:webInspectorFrontend.get()]; + m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient.release()); } void WebInspectorClient::highlight(Node* node) @@ -201,6 +202,20 @@ void WebInspectorFrontendClient::inspectedURLChanged(const String& newURL) updateWindowTitle(); } +void WebInspectorFrontendClient::saveSessionSetting(const String& key, const String& value) +{ + WebInspectorClient* client = [m_windowController.get() inspectorClient]; + if (client) + client->saveSessionSetting(key, value); +} + +void WebInspectorFrontendClient::loadSessionSetting(const String& key, String* value) +{ + WebInspectorClient* client = [m_windowController.get() inspectorClient]; + if (client) + client->loadSessionSetting(key, value); +} + void WebInspectorFrontendClient::updateWindowTitle() const { NSString *title = [NSString stringWithFormat:UI_STRING_INTERNAL("Web Inspector — %@", "Web Inspector window title"), (NSString *)m_inspectedURL]; @@ -422,6 +437,11 @@ void WebInspectorFrontendClient::updateWindowTitle() const _inspectorClient = inspectorClient; } +- (WebInspectorClient*)inspectorClient +{ + return _inspectorClient; +} + - (void)setAttachedWindowHeight:(unsigned)height { if (!_attachedToInspectedWebView) |