Commit 100f1a19 authored by pfeldman@chromium.org's avatar pfeldman@chromium.org

DevTools: Remove base/ dependencies from glue/devtools

BUG=24622,24597

Review URL: http://codereview.chromium.org/330029

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30330 0039d316-1c4b-4281-b951-d872f2087c98
parent 3af0c5be
......@@ -10,16 +10,17 @@
#include "chrome/common/render_messages.h"
#include "chrome/renderer/render_thread.h"
#include "chrome/renderer/render_view.h"
#include "webkit/api/public/WebDevToolsFrontend.h"
#include "webkit/api/public/WebString.h"
#include "webkit/glue/webdevtoolsclient.h"
using WebKit::WebDevToolsFrontend;
using WebKit::WebString;
DevToolsClient::DevToolsClient(RenderView* view)
: render_view_(view) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
web_tools_client_.reset(
WebDevToolsClient::Create(
web_tools_frontend_.reset(
WebDevToolsFrontend::create(
view->webview(),
this,
WideToUTF16Hack(command_line.GetSwitchValue(switches::kLang))));
......@@ -46,7 +47,7 @@ bool DevToolsClient::OnMessageReceived(const IPC::Message& message) {
return handled;
}
void DevToolsClient::SendMessageToAgent(const WebString& class_name,
void DevToolsClient::sendMessageToAgent(const WebString& class_name,
const WebString& method_name,
const WebString& param1,
const WebString& param2,
......@@ -59,31 +60,31 @@ void DevToolsClient::SendMessageToAgent(const WebString& class_name,
param3.utf8()));
}
void DevToolsClient::SendDebuggerCommandToAgent(const WebString& command) {
void DevToolsClient::sendDebuggerCommandToAgent(const WebString& command) {
Send(DevToolsAgentMsg_DebuggerCommand(command.utf8()));
}
void DevToolsClient::ActivateWindow() {
void DevToolsClient::activateWindow() {
render_view_->Send(new ViewHostMsg_ActivateDevToolsWindow(
render_view_->routing_id()));
}
void DevToolsClient::CloseWindow() {
void DevToolsClient::closeWindow() {
render_view_->Send(new ViewHostMsg_CloseDevToolsWindow(
render_view_->routing_id()));
}
void DevToolsClient::DockWindow() {
void DevToolsClient::dockWindow() {
render_view_->Send(new ViewHostMsg_DockDevToolsWindow(
render_view_->routing_id()));
}
void DevToolsClient::UndockWindow() {
void DevToolsClient::undockWindow() {
render_view_->Send(new ViewHostMsg_UndockDevToolsWindow(
render_view_->routing_id()));
}
void DevToolsClient::ToggleInspectElementMode(bool enabled) {
void DevToolsClient::toggleInspectElementMode(bool enabled) {
render_view_->Send(new ViewHostMsg_ToggleInspectElementMode(
render_view_->routing_id(), enabled));
}
......@@ -94,7 +95,7 @@ void DevToolsClient::OnRpcMessage(const std::string& class_name,
const std::string& param1,
const std::string& param2,
const std::string& param3) {
web_tools_client_->DispatchMessageFromAgent(
web_tools_frontend_->dispatchMessageFromAgent(
WebString::fromUTF8(class_name),
WebString::fromUTF8(method_name),
WebString::fromUTF8(param1),
......
......@@ -7,15 +7,19 @@
#include <string>
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "webkit/glue/webdevtoolsclient_delegate.h"
#include "webkit/api/public/WebDevToolsFrontendClient.h"
namespace IPC {
class Message;
}
class MessageLoop;
class RenderView;
class WebDevToolsClient;
namespace WebKit {
class WebDevToolsFrontend;
}
// Developer tools UI end of communication channel between the render process of
// the page being inspected and tools UI renderer process. All messages will
......@@ -23,7 +27,7 @@ class WebDevToolsClient;
// corresponding DevToolsAgent object.
// TODO(yurys): now the client is almost empty later it will delegate calls to
// code in glue
class DevToolsClient : public WebDevToolsClientDelegate {
class DevToolsClient : public WebKit::WebDevToolsFrontendClient {
public:
explicit DevToolsClient(RenderView* view);
virtual ~DevToolsClient();
......@@ -32,19 +36,19 @@ class DevToolsClient : public WebDevToolsClientDelegate {
// handled. Called in render thread.
bool OnMessageReceived(const IPC::Message& message);
// WebDevToolsClient::Delegate implementation
virtual void SendMessageToAgent(const WebKit::WebString& class_name,
// WebDevToolsFrontendClient implementation
virtual void sendMessageToAgent(const WebKit::WebString& class_name,
const WebKit::WebString& method_name,
const WebKit::WebString& param1,
const WebKit::WebString& param2,
const WebKit::WebString& param3);
virtual void SendDebuggerCommandToAgent(const WebKit::WebString& command);
virtual void sendDebuggerCommandToAgent(const WebKit::WebString& command);
virtual void ActivateWindow();
virtual void CloseWindow();
virtual void DockWindow();
virtual void UndockWindow();
virtual void ToggleInspectElementMode(bool enabled);
virtual void activateWindow();
virtual void closeWindow();
virtual void dockWindow();
virtual void undockWindow();
virtual void toggleInspectElementMode(bool enabled);
private:
void OnRpcMessage(const std::string& class_name,
......@@ -57,7 +61,7 @@ class DevToolsClient : public WebDevToolsClientDelegate {
void Send(const IPC::Message& tools_agent_message);
RenderView* render_view_; // host render view
scoped_ptr<WebDevToolsClient> web_tools_client_;
scoped_ptr<WebKit::WebDevToolsFrontend> web_tools_frontend_;
DISALLOW_COPY_AND_ASSIGN(DevToolsClient);
};
......
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebDevToolsFrontend_h
#define WebDevToolsFrontend_h
#include "WebCommon.h"
namespace WebKit {
class WebDevToolsFrontendClient;
class WebString;
class WebView;
// WebDevToolsFrontend represents DevTools client sitting in the Glue. It provides
// direct and delegate Apis to the host.
class WebDevToolsFrontend {
public:
static WebDevToolsFrontend* create(WebView* view,
WebDevToolsFrontendClient* client,
const WebString& applicationLocale);
WebDevToolsFrontend() {}
virtual ~WebDevToolsFrontend() {}
virtual void dispatchMessageFromAgent(const WebString& className,
const WebString& methodName,
const WebString& param1,
const WebString& param2,
const WebString& param3) = 0;
};
} // namespace WebKit
#endif
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebDevToolsFrontendClient_h
#define WebDevToolsFrontendClient_h
namespace WebKit {
class WebString;
class WebDevToolsFrontendClient {
public:
WebDevToolsFrontendClient() {}
virtual void sendMessageToAgent(const WebString& className,
const WebString& methodName,
const WebString& param1,
const WebString& param2,
const WebString& param3) = 0;
virtual void sendDebuggerCommandToAgent(const WebString& command) = 0;
virtual void activateWindow() = 0;
virtual void closeWindow() = 0;
virtual void dockWindow() = 0;
virtual void undockWindow() = 0;
virtual void toggleInspectElementMode(bool enabled) = 0;
protected:
virtual ~WebDevToolsFrontendClient() {}
};
} // namespace WebKit
#endif
......@@ -5,11 +5,13 @@
#ifndef WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_
#define WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_
#include <wtf/Noncopyable.h>
#include "v8.h"
// BoundObject lets you map JavaScript method calls and property accesses
// directly to C++ method calls and V8 variable access.
class BoundObject {
class BoundObject : public Noncopyable {
public:
BoundObject(v8::Handle<v8::Context> context,
void* v8_this,
......@@ -25,7 +27,6 @@ class BoundObject {
v8::Persistent<v8::FunctionTemplate> host_template_;
v8::Persistent<v8::External> v8_this_;
v8::Persistent<v8::Object> bound_object_;
DISALLOW_COPY_AND_ASSIGN(BoundObject);
};
#endif // WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_
......@@ -16,7 +16,6 @@
#include "V8Proxy.h"
#undef LOG
#include "base/string_piece.h"
#include "grit/webkit_resources.h"
#include "webkit/glue/devtools/debugger_agent_impl.h"
#include "webkit/glue/devtools/debugger_agent_manager.h"
......@@ -62,7 +61,7 @@ void DebuggerAgentImpl::GetContextId() {
void DebuggerAgentImpl::StartProfiling(int flags) {
v8::HandleScope scope;
WebCore::Frame* frame = GetPage()->mainFrame();
DCHECK(V8Proxy::retrieve(GetPage()->mainFrame())->isContextInitialized());
ASSERT(V8Proxy::retrieve(GetPage()->mainFrame())->isContextInitialized());
v8::Context::Scope context_scope(V8Proxy::context(frame));
v8::V8::ResumeProfilerEx(flags);
}
......
......@@ -6,6 +6,7 @@
#define WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_IMPL_H_
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
#include "v8.h"
#include "webkit/glue/devtools/debugger_agent.h"
......@@ -72,8 +73,6 @@ class DebuggerAgentImpl : public DebuggerAgent {
DebuggerAgentDelegate* delegate_;
WebDevToolsAgentImpl* webdevtools_agent_;
int profiler_log_position_;
DISALLOW_COPY_AND_ASSIGN(DebuggerAgentImpl);
};
#endif // WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_IMPL_H_
......@@ -10,7 +10,6 @@
#include <wtf/HashSet.h>
#undef LOG
#include "base/string_util.h"
#include "webkit/api/public/WebDevToolsAgent.h"
#include "webkit/glue/devtools/debugger_agent_impl.h"
#include "webkit/glue/devtools/debugger_agent_manager.h"
......@@ -117,18 +116,18 @@ void DebuggerAgentManager::DebugAttach(DebuggerAgentImpl* debugger_agent) {
&DebuggerAgentManager::V8DebugHostDispatchHandler, 100 /* ms */);
}
int host_id = debugger_agent->webdevtools_agent()->host_id();
DCHECK(host_id != 0);
ASSERT(host_id != 0);
attached_agents_map_->set(host_id, debugger_agent);
}
// static
void DebuggerAgentManager::DebugDetach(DebuggerAgentImpl* debugger_agent) {
if (!attached_agents_map_) {
NOTREACHED();
ASSERT_NOT_REACHED();
return;
}
int host_id = debugger_agent->webdevtools_agent()->host_id();
DCHECK(attached_agents_map_->get(host_id) == debugger_agent);
ASSERT(attached_agents_map_->get(host_id) == debugger_agent);
bool is_on_breakpoint = (FindAgentForCurrentV8Context() == debugger_agent);
attached_agents_map_->remove(host_id);
......@@ -163,7 +162,7 @@ void DebuggerAgentManager::DebugDetach(DebuggerAgentImpl* debugger_agent) {
// static
void DebuggerAgentManager::DebugBreak(DebuggerAgentImpl* debugger_agent) {
#if USE(V8)
DCHECK(DebuggerAgentForHostId(debugger_agent->webdevtools_agent()->host_id())
ASSERT(DebuggerAgentForHostId(debugger_agent->webdevtools_agent()->host_id())
== debugger_agent);
if (in_utility_context_) {
debug_break_delayed_ = true;
......@@ -196,7 +195,7 @@ void DebuggerAgentManager::OnV8DebugMessage(const v8::Debug::Message& message) {
}
return;
} // Otherwise it's an event message.
DCHECK(message.IsEvent());
ASSERT(message.IsEvent());
// Ignore unsupported event types.
if (message.GetEvent() != v8::AfterCompile &&
......@@ -254,7 +253,7 @@ void DebuggerAgentManager::SetMessageLoopDispatchHandler(
// static
void DebuggerAgentManager::SetHostId(WebFrameImpl* webframe, int host_id) {
DCHECK(host_id > 0);
ASSERT(host_id > 0);
WebCore::V8Proxy* proxy = WebCore::V8Proxy::retrieve(webframe->frame());
if (proxy) {
proxy->setContextDebugId(host_id);
......@@ -297,7 +296,7 @@ DebuggerAgentImpl* DebuggerAgentManager::FindAgentForCurrentV8Context() {
if (!attached_agents_map_) {
return NULL;
}
DCHECK(!attached_agents_map_->isEmpty());
ASSERT(!attached_agents_map_->isEmpty());
WebCore::Frame* frame = WebCore::V8Proxy::retrieveFrameForEnteredContext();
if (!frame) {
......
......@@ -6,9 +6,8 @@
#define WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
#include "base/basictypes.h"
#include "base/logging.h"
#include "v8/include/v8-debug.h"
#include "webkit/api/public/WebDevToolsAgent.h"
......@@ -33,7 +32,7 @@ class WebViewImpl;
// would expect some actions from the handler. If there is no appropriate
// debugger agent to handle such messages the manager will perform the action
// itself, otherwise v8 may hang waiting for the action.
class DebuggerAgentManager {
class DebuggerAgentManager : public Noncopyable {
public:
static void DebugAttach(DebuggerAgentImpl* debugger_agent);
static void DebugDetach(DebuggerAgentImpl* debugger_agent);
......@@ -53,10 +52,10 @@ class DebuggerAgentManager {
static void OnNavigate();
class UtilityContextScope {
class UtilityContextScope : public Noncopyable {
public:
UtilityContextScope() {
DCHECK(!in_utility_context_);
ASSERT(!in_utility_context_);
in_utility_context_ = true;
}
~UtilityContextScope() {
......@@ -66,8 +65,6 @@ class DebuggerAgentManager {
}
in_utility_context_ = false;
}
private:
DISALLOW_COPY_AND_ASSIGN(UtilityContextScope);
};
private:
......@@ -95,8 +92,6 @@ class DebuggerAgentManager {
static bool in_utility_context_;
static bool debug_break_delayed_;
DISALLOW_COPY_AND_ASSIGN(DebuggerAgentManager);
};
#endif // WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_
......@@ -52,9 +52,7 @@
#include "PlatformString.h"
// TODO(darin): Remove these dependencies on Chromium base/.
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include <wtf/Noncopyable.h>
namespace WebCore {
class String;
......@@ -74,7 +72,7 @@ template<>
struct RpcTypeTrait<bool> {
typedef bool ApiType;
static bool Parse(const WebCore::String& t) {
ALLOW_UNUSED bool success;
bool success;
int i = t.toIntStrict(&success);
ASSERT(success);
return i;
......@@ -88,7 +86,7 @@ template<>
struct RpcTypeTrait<int> {
typedef int ApiType;
static int Parse(const WebCore::String& t) {
ALLOW_UNUSED bool success;
bool success;
int i = t.toIntStrict(&success);
ASSERT(success);
return i;
......@@ -206,7 +204,7 @@ if (method_name == #Method) { \
// serializing method calls and ClassDispatch that is capable of dispatching
// the serialized message into its delegate.
#define DEFINE_RPC_CLASS(Class, STRUCT) \
class Class {\
class Class : public Noncopyable {\
public: \
Class() { \
class_name = #Class; \
......@@ -219,11 +217,11 @@ class Class {\
TOOLS_RPC_API_METHOD2, \
TOOLS_RPC_API_METHOD3) \
WebCore::String class_name; \
private: \
DISALLOW_COPY_AND_ASSIGN(Class); \
}; \
\
class Class##Stub : public Class, public DevToolsRpc { \
class Class##Stub \
: public Class, \
public DevToolsRpc { \
public: \
explicit Class##Stub(Delegate* delegate) : DevToolsRpc(delegate) {} \
virtual ~Class##Stub() {} \
......@@ -233,11 +231,9 @@ class Class##Stub : public Class, public DevToolsRpc { \
TOOLS_RPC_STUB_METHOD1, \
TOOLS_RPC_STUB_METHOD2, \
TOOLS_RPC_STUB_METHOD3) \
private: \
DISALLOW_COPY_AND_ASSIGN(Class##Stub); \
}; \
\
class Class##Dispatch { \
class Class##Dispatch : public Noncopyable { \
public: \
Class##Dispatch() {} \
virtual ~Class##Dispatch() {} \
......@@ -259,8 +255,6 @@ class Class##Dispatch { \
TOOLS_RPC_DISPATCH3) \
return false; \
} \
private: \
DISALLOW_COPY_AND_ASSIGN(Class##Dispatch); \
};
///////////////////////////////////////////////////////
......@@ -276,8 +270,6 @@ class DevToolsRpc {
const WebCore::String& p1 = "",
const WebCore::String& p2 = "",
const WebCore::String& p3 = "") = 0;
private:
DISALLOW_COPY_AND_ASSIGN(Delegate);
};
explicit DevToolsRpc(Delegate* delegate)
......@@ -286,8 +278,6 @@ class DevToolsRpc {
protected:
Delegate* delegate_;
private:
DISALLOW_COPY_AND_ASSIGN(DevToolsRpc);
};
#endif // WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_H_
......@@ -8,9 +8,9 @@
#define WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_JS_H_
// Do not remove this one although it is not used.
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
#include "base/basictypes.h"
#include "webkit/api/public/WebFrame.h"
#include "webkit/glue/devtools/bound_object.h"
#include "webkit/glue/devtools/devtools_rpc.h"
......@@ -106,7 +106,6 @@ class Js##Class##BoundObj : public Class##Stub { \
param3); \
} \
OwnPtr<BoundObject> bound_obj_; \
DISALLOW_COPY_AND_ASSIGN(Js##Class##BoundObj); \
};
#endif // WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_JS_H_
......@@ -119,7 +119,6 @@ class WebDevToolsAgentImpl : public WebKit::WebDevToolsAgent,
v8::Persistent<v8::Context> utility_context_;
OwnPtr<BoundObject> devtools_agent_host_;
OwnPtr<WebCore::ScriptState> inspector_frontend_script_state_;
DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgentImpl);
};
#endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_WEBDEVTOOLSCLIENT_H_
#define WEBKIT_GLUE_WEBDEVTOOLSCLIENT_H_
#include "base/basictypes.h"
class WebDevToolsClientDelegate;
namespace WebKit {
class WebString;
class WebView;
}
// WebDevToolsClient represents DevTools client sitting in the Glue. It provides
// direct and delegate Apis to the host.
class WebDevToolsClient {
public:
static WebDevToolsClient* Create(
WebKit::WebView* view,
WebDevToolsClientDelegate* delegate,
const WebKit::WebString& application_locale);
WebDevToolsClient() {}
virtual ~WebDevToolsClient() {}
virtual void DispatchMessageFromAgent(const WebKit::WebString& class_name,
const WebKit::WebString& method_name,
const WebKit::WebString& param1,
const WebKit::WebString& param2,
const WebKit::WebString& param3) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(WebDevToolsClient);
};
#endif // WEBKIT_GLUE_WEBDEVTOOLSCLIENT_H_
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_WEBDEVTOOLSCLIENT_DELEGATE_H_
#define WEBKIT_GLUE_WEBDEVTOOLSCLIENT_DELEGATE_H_
#include "base/basictypes.h"
namespace WebKit {
class WebString;
}
class WebDevToolsClientDelegate {
public:
WebDevToolsClientDelegate() {}
virtual ~WebDevToolsClientDelegate() {}
virtual void SendMessageToAgent(const WebKit::WebString& class_name,
const WebKit::WebString& method_name,
const WebKit::WebString& param1,
const WebKit::WebString& param2,
const WebKit::WebString& param3) = 0;
virtual void SendDebuggerCommandToAgent(const WebKit::WebString& command) = 0;
virtual void ActivateWindow() = 0;
virtual void CloseWindow() = 0;
virtual void DockWindow() = 0;
virtual void UndockWindow() = 0;
virtual void ToggleInspectElementMode(bool enabled) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(WebDevToolsClientDelegate);
};
#endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_DELEGATE_H_
......@@ -2,18 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_
#define WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_
#ifndef WEBKIT_GLUE_WEBDEVTOOLSFRONTEND_IMPL_H_
#define WEBKIT_GLUE_WEBDEVTOOLSFRONTEND_IMPL_H_
#include <string>
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
#include "v8.h"
#include "webkit/api/public/WebDevToolsFrontend.h"
#include "webkit/glue/devtools/devtools_rpc.h"
#include "webkit/glue/webdevtoolsclient.h"
namespace WebCore {
class Node;
......@@ -29,14 +30,15 @@ class ToolsAgentNativeDelegateImpl;
class WebDevToolsClientDelegate;
class WebViewImpl;
class WebDevToolsClientImpl : public WebDevToolsClient,
public DevToolsRpc::Delegate {
class WebDevToolsFrontendImpl : public WebKit::WebDevToolsFrontend,
public DevToolsRpc::Delegate,
public Noncopyable {
public:
WebDevToolsClientImpl(
WebDevToolsFrontendImpl(
WebViewImpl* web_view_impl,
WebDevToolsClientDelegate* delegate,
WebKit::WebDevToolsFrontendClient* client,
const String& application_locale);
virtual ~WebDevToolsClientImpl();
virtual ~WebDevToolsFrontendImpl();
// DevToolsRpc::Delegate implementation.
virtual void SendRpcMessage(const String& class_name,
......@@ -45,8 +47,8 @@ class WebDevToolsClientImpl : public WebDevToolsClient,
const String& param2,
const String& param3);
// WebDevToolsClient implementation.
virtual void DispatchMessageFromAgent(const WebKit::WebString& class_name,
// WebDevToolsFrontend implementation.
virtual void dispatchMessageFromAgent(const WebKit::WebString& class_name,
const WebKit::WebString& method_name,
const WebKit::WebString& param1,
const WebKit::WebString& param2,
......@@ -79,7 +81,7 @@ class WebDevToolsClientImpl : public WebDevToolsClient,
const v8::Arguments& args);
WebViewImpl* web_view_impl_;
WebDevToolsClientDelegate* delegate_;
WebKit::WebDevToolsFrontendClient* client_;
String application_locale_;
OwnPtr<BoundObject> debugger_command_executor_obj_;
OwnPtr<JsDebuggerAgentBoundObj> debugger_agent_obj_;
......@@ -88,7 +90,6 @@ class WebDevToolsClientImpl : public WebDevToolsClient,
Vector<Vector<String> > pending_incoming_messages_;
OwnPtr<BoundObject> dev_tools_host_;
OwnPtr<ToolsAgentNativeDelegateImpl> tools_agent_native_delegate_impl_;
DISALLOW_COPY_AND_ASSIGN(WebDevToolsClientImpl);
};
#endif // WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_
#endif // WEBKIT_GLUE_WEBDEVTOOLSFRONTEND_IMPL_H_
......@@ -98,6 +98,8 @@
'api/public/WebDataSource.h',
'api/public/WebDevToolsAgent.h',
'api/public/WebDevToolsAgentClient.h',
'api/public/WebDevToolsFrontend.h',
'api/public/WebDevToolsFrontendClient.h',
'api/public/WebDragData.h',
'api/public/WebEditingAction.h',
'api/public/WebFileChooserCompletion.h',
......@@ -632,10 +634,8 @@
'glue/webcursor_win.cc',
'glue/webdevtoolsagent_impl.cc',
'glue/webdevtoolsagent_impl.h',
'glue/webdevtoolsclient.h',
'glue/webdevtoolsclient_delegate.h',
'glue/webdevtoolsclient_impl.cc',
'glue/webdevtoolsclient_impl.h',
'glue/webdevtoolsfrontend_impl.cc',
'glue/webdevtoolsfrontend_impl.h',
'glue/webdropdata.cc',
'glue/webdropdata_win.cc',
'glue/webdropdata.h',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment