2 * Copyright (C) 2010 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
26 #ifndef WebInspectorClient_h
27 #define WebInspectorClient_h
31 #include "PageOverlay.h"
32 #if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
33 #include "WebInspectorServerTizen.h"
36 #include <WebCore/InspectorClient.h>
37 #include <WebCore/InspectorFrontendChannel.h>
40 class GraphicsContext;
48 class WebInspectorClient : public WebCore::InspectorClient, public WebCore::InspectorFrontendChannel, private PageOverlay::Client {
50 WebInspectorClient(WebPage* page)
52 , m_highlightOverlay(0)
54 #if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
55 m_remoteFrontend = false;
56 WebInspectorServerTizen::server()->registerClient(this);
60 #if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
61 void attachRemoteFrontend();
62 void detachRemoteFrontend();
66 virtual void inspectorDestroyed() OVERRIDE;
68 virtual InspectorFrontendChannel* openInspectorFrontend(WebCore::InspectorController*) OVERRIDE;
69 virtual void closeInspectorFrontend() OVERRIDE;
70 virtual void bringFrontendToFront() OVERRIDE;
71 virtual void didResizeMainFrame(WebCore::Frame*) OVERRIDE;
73 virtual void highlight() OVERRIDE;
74 virtual void hideHighlight() OVERRIDE;
76 virtual bool sendMessageToFrontend(const String&) OVERRIDE;
78 // PageOverlay::Client
79 virtual void pageOverlayDestroyed(PageOverlay*) OVERRIDE;
80 virtual void willMoveToWebPage(PageOverlay*, WebPage*) OVERRIDE;
81 virtual void didMoveToWebPage(PageOverlay*, WebPage*) OVERRIDE;
82 virtual void drawRect(PageOverlay*, WebCore::GraphicsContext&, const WebCore::IntRect&) OVERRIDE;
83 virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&) OVERRIDE;
86 PageOverlay* m_highlightOverlay;
87 #if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
88 bool m_remoteFrontend;
89 friend class WebInspectorServerTizen;
95 #endif // ENABLE(INSPECTOR)
97 #endif // WebInspectorClient_h