Web Inspector: Remove leftover 'device metrics' code
[WebKit-https.git] / Source / WebKit / blackberry / WebCoreSupport / InspectorClientBlackBerry.cpp
1 /*
2  * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
3  * Copyright (C) 2011, 2012 Research In Motion Limited. All rights reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19
20 #include "config.h"
21 #include "InspectorClientBlackBerry.h"
22
23 #include "BackingStore.h"
24 #include "Frame.h"
25 #include "GraphicsContext.h"
26 #include "InspectorController.h"
27 #include "NotImplemented.h"
28 #include "Page.h"
29 #include "RenderObject.h"
30 #include "WebPageClient.h"
31 #include "WebPage_p.h"
32
33 namespace WebCore {
34
35 InspectorClientBlackBerry::InspectorClientBlackBerry(BlackBerry::WebKit::WebPagePrivate* webPagePrivate)
36     : m_webPagePrivate(webPagePrivate)
37 {
38     m_inspectorSettingsMap = adoptPtr(new SettingsMap);
39 }
40
41 void InspectorClientBlackBerry::inspectorDestroyed()
42 {
43     delete this;
44 }
45
46 void InspectorClientBlackBerry::highlight()
47 {
48     m_webPagePrivate->setInspectorOverlayClient(this);
49 }
50
51 void InspectorClientBlackBerry::hideHighlight()
52 {
53     m_webPagePrivate->setInspectorOverlayClient(0);
54 }
55
56 InspectorFrontendChannel* InspectorClientBlackBerry::openInspectorFrontend(InspectorController*)
57 {
58     notImplemented();
59     return 0;
60 }
61
62 void InspectorClientBlackBerry::closeInspectorFrontend()
63 {
64     notImplemented();
65 }
66
67 void InspectorClientBlackBerry::bringFrontendToFront()
68 {
69     notImplemented();
70 }
71
72 bool InspectorClientBlackBerry::sendMessageToFrontend(const String& message)
73 {
74     CString utf8Message = message.utf8();
75     m_webPagePrivate->m_client->handleWebInspectorMessageToFrontend(0, utf8Message.data(), utf8Message.length());
76     return true;
77 }
78
79 void InspectorClientBlackBerry::clearBrowserCache()
80 {
81     m_webPagePrivate->m_client->clearCache();
82 }
83
84 void InspectorClientBlackBerry::clearBrowserCookies()
85 {
86     m_webPagePrivate->m_client->clearCookies();
87 }
88
89 bool InspectorClientBlackBerry::supportsFrameInstrumentation()
90 {
91     return true;
92 }
93
94 void InspectorClientBlackBerry::paintInspectorOverlay(GraphicsContext& gc)
95 {
96     InspectorController* inspectorController = m_webPagePrivate->m_page->inspectorController();
97     if (inspectorController)
98         inspectorController->drawHighlight(gc);
99 }
100
101 } // namespace WebCore