Loosen up heuristics for detecting account creation forms.
[chromium-blink-merge.git] / content / renderer / devtools_agent.h
blob8e90f05f776f749606f07f1d44fb4012a0329f71
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_DEVTOOLS_AGENT_H_
6 #define CONTENT_RENDERER_DEVTOOLS_AGENT_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "content/public/common/console_message_level.h"
12 #include "content/public/renderer/render_view_observer.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgentClient.h"
15 class RenderViewImpl;
17 namespace WebKit {
18 class WebDevToolsAgent;
21 // DevToolsAgent belongs to the inspectable RenderView and provides Glue's
22 // agents with the communication capabilities. All messages from/to Glue's
23 // agents infrastructure are flowing through this communication agent.
24 // There is a corresponding DevToolsClient object on the client side.
25 class DevToolsAgent : public content::RenderViewObserver,
26 public WebKit::WebDevToolsAgentClient {
27 public:
28 explicit DevToolsAgent(RenderViewImpl* render_view);
29 virtual ~DevToolsAgent();
31 // Returns agent instance for its host id.
32 static DevToolsAgent* FromHostId(int host_id);
34 WebKit::WebDevToolsAgent* GetWebAgent();
36 bool IsAttached();
38 private:
39 friend class DevToolsAgentFilter;
41 // RenderView::Observer implementation.
42 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
44 // WebDevToolsAgentClient implementation
45 virtual void sendMessageToInspectorFrontend(const WebKit::WebString& data);
47 virtual int hostIdentifier();
48 virtual void saveAgentRuntimeState(const WebKit::WebString& state);
49 virtual WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
50 createClientMessageLoop();
51 virtual void clearBrowserCache();
52 virtual void clearBrowserCookies();
54 void OnAttach();
55 void OnReattach(const std::string& agent_state);
56 void OnDetach();
57 void OnDispatchOnInspectorBackend(const std::string& message);
58 void OnInspectElement(int x, int y);
59 void OnAddMessageToConsole(content::ConsoleMessageLevel level,
60 const std::string& message);
61 void ContinueProgram();
62 void OnSetupDevToolsClient();
64 bool is_attached_;
66 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent);
69 #endif // CONTENT_RENDERER_DEVTOOLS_AGENT_H_