2 * Copyright (C) 2010 Google 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 are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #include "InspectorFrontendClientImpl.h"
34 #include "InspectorFrontendHost.h"
36 #include "PlatformString.h"
37 #include "V8InspectorFrontendHost.h"
39 #include "WebDevToolsFrontendClient.h"
40 #include "WebDevToolsFrontendImpl.h"
42 using namespace WebCore;
46 InspectorFrontendClientImpl::InspectorFrontendClientImpl(Page* frontendPage, WebDevToolsFrontendClient* client, WebDevToolsFrontendImpl* frontend)
47 : m_frontendPage(frontendPage)
49 , m_frontend(frontend)
53 InspectorFrontendClientImpl::~InspectorFrontendClientImpl()
56 m_frontendHost->disconnectClient();
60 void InspectorFrontendClientImpl::windowObjectCleared()
62 v8::HandleScope handleScope;
63 v8::Handle<v8::Context> frameContext = V8Proxy::context(m_frontendPage->mainFrame());
64 v8::Context::Scope contextScope(frameContext);
66 ASSERT(!m_frontendHost);
67 m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage);
68 v8::Handle<v8::Value> frontendHostObj = toV8(m_frontendHost.get());
69 v8::Handle<v8::Object> global = frameContext->Global();
71 global->Set(v8::String::New("InspectorFrontendHost"), frontendHostObj);
72 #if ENABLE(V8_SCRIPT_DEBUG_SERVER)
73 global->Set(v8::String::New("v8ScriptDebugServerEnabled"), v8::True());
77 void InspectorFrontendClientImpl::frontendLoaded()
79 m_frontend->frontendLoaded();
82 void InspectorFrontendClientImpl::moveWindowBy(float x, float y)
86 String InspectorFrontendClientImpl::localizedStringsURL()
91 String InspectorFrontendClientImpl::hiddenPanels()
96 void InspectorFrontendClientImpl::bringToFront()
98 m_client->activateWindow();
101 void InspectorFrontendClientImpl::closeWindow()
103 m_client->closeWindow();
106 void InspectorFrontendClientImpl::requestAttachWindow()
108 m_client->requestDockWindow();
111 void InspectorFrontendClientImpl::requestDetachWindow()
113 m_client->requestUndockWindow();
116 void InspectorFrontendClientImpl::changeAttachedWindowHeight(unsigned)
121 void InspectorFrontendClientImpl::inspectedURLChanged(const String&)
126 } // namespace WebKit