diff options
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/WebInspector.h')
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/WebInspector.h | 116 |
1 files changed, 48 insertions, 68 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspector.h b/Source/WebKit2/WebProcess/WebPage/WebInspector.h index 14f5a3ba6..c1a67a779 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebInspector.h +++ b/Source/WebKit2/WebProcess/WebPage/WebInspector.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2014, 2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,116 +23,96 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebInspector_h -#define WebInspector_h - -#if ENABLE(INSPECTOR) +#pragma once #include "APIObject.h" #include "Connection.h" -#include <WebCore/InspectorForwarding.h> +#include "MessageReceiver.h" +#include <inspector/InspectorFrontendChannel.h> #include <wtf/Noncopyable.h> #include <wtf/text/WTFString.h> namespace WebKit { -class WebInspectorFrontendClient; class WebPage; -class WebInspector : public API::ObjectImpl<API::Object::Type::BundleInspector> { +class WebInspector : public API::ObjectImpl<API::Object::Type::BundleInspector>, public IPC::Connection::Client, public Inspector::FrontendChannel { public: - static PassRefPtr<WebInspector> create(WebPage*, WebCore::InspectorFrontendChannel*); + static Ref<WebInspector> create(WebPage*); WebPage* page() const { return m_page; } - WebPage* inspectorPage() const { return m_inspectorPage; } + + void updateDockingAvailability(); + + void sendMessageToFrontend(const String& message) override; + ConnectionType connectionType() const override { return ConnectionType::Local; } // Implemented in generated WebInspectorMessageReceiver.cpp - void didReceiveWebInspectorMessage(IPC::Connection*, IPC::MessageDecoder&); + void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; + + // IPC::Connection::Client + void didClose(IPC::Connection&) override { close(); } + void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference, IPC::StringReference) override { close(); } // Called by WebInspector messages + void connectionEstablished(); + void show(); void close(); - void didSave(const String& url); - void didAppend(const String& url); + void openInNewTab(const String& urlString); + + void canAttachWindow(bool& result); + + void showConsole(); + void showResources(); + void showTimelines(); - void attachedBottom(); - void attachedRight(); - void detached(); + void showMainResourceForFrame(uint64_t frameIdentifier); - void evaluateScriptForTest(long callID, const String& script); + void setAttached(bool attached) { m_attached = attached; } + + void evaluateScriptForTest(const String& script); - void setJavaScriptProfilingEnabled(bool); void startPageProfiling(); void stopPageProfiling(); + void startElementSelection(); + void stopElementSelection(); + void elementSelectionChanged(bool); + + void sendMessageToBackend(const String&); + #if ENABLE(INSPECTOR_SERVER) - bool hasRemoteFrontendConnected() const { return m_remoteFrontendConnected; } - void sendMessageToRemoteFrontend(const String& message); - void dispatchMessageFromRemoteFrontend(const String& message); void remoteFrontendConnected(); void remoteFrontendDisconnected(); #endif + void disconnectFromPage() { close(); } + private: friend class WebInspectorClient; - friend class WebInspectorFrontendClient; - explicit WebInspector(WebPage*, WebCore::InspectorFrontendChannel*); + explicit WebInspector(WebPage*); + virtual ~WebInspector(); + + bool canAttachWindow(); // Called from WebInspectorClient - WebPage* createInspectorPage(); - void destroyInspectorPage(); + void openFrontendConnection(bool underTest); + void closeFrontendConnection(); - // Called from WebInspectorFrontendClient - void didClose(); void bringToFront(); - void inspectedURLChanged(const String&); - - bool canSave() const; - void save(const String& filename, const String& content, bool base64Encoded, bool forceSaveAs); - void append(const String& filename, const String& content); - void attachBottom(); - void attachRight(); - void detach(); - - void setAttachedWindowHeight(unsigned); - void setAttachedWindowWidth(unsigned); - void setToolbarHeight(unsigned); - - // Implemented in platform WebInspector file - String localizedStringsURL() const; - - void showConsole(); - - void showResources(); - - void showMainResourceForFrame(uint64_t frameID); - - void startJavaScriptDebugging(); - void stopJavaScriptDebugging(); - - void startJavaScriptProfiling(); - void stopJavaScriptProfiling(); + WebPage* m_page; - void updateDockingAvailability(); + RefPtr<IPC::Connection> m_frontendConnection; - WebPage* m_page; - WebPage* m_inspectorPage; - WebInspectorFrontendClient* m_frontendClient; - WebCore::InspectorFrontendChannel* m_frontendChannel; -#if PLATFORM(MAC) - mutable String m_localizedStringsURL; - mutable bool m_hasLocalizedStringsURL; -#endif + bool m_attached { false }; + bool m_previousCanAttach { false }; #if ENABLE(INSPECTOR_SERVER) - bool m_remoteFrontendConnected; + bool m_remoteFrontendConnected { false }; #endif }; } // namespace WebKit - -#endif // ENABLE(INSPECTOR) - -#endif // WebInspector_h |