Respond with QuotaExceededError when IndexedDB has no disk space on open.
[chromium-blink-merge.git] / content / browser / devtools / devtools_agent_host_impl.h
blob9bd800dc3986453e344f4c43e8c9f2515700acb5
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_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "content/common/content_export.h"
12 #include "content/public/browser/devtools_agent_host.h"
14 namespace IPC {
15 class Message;
18 namespace content {
20 // Describes interface for managing devtools agents from the browser process.
21 class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost {
22 public:
23 class CONTENT_EXPORT CloseListener {
24 public:
25 virtual void AgentHostClosing(DevToolsAgentHostImpl*) = 0;
26 protected:
27 virtual ~CloseListener() {}
30 // Informs the hosted agent that a client host has attached.
31 virtual void Attach() = 0;
33 // Informs the hosted agent that a client host has detached.
34 virtual void Detach() = 0;
36 // Sends a message to the agent hosted by this object.
37 virtual void DispatchOnInspectorBackend(const std::string& message) = 0;
39 void set_close_listener(CloseListener* listener) {
40 close_listener_ = listener;
43 // DevToolsAgentHost implementation.
44 virtual bool IsAttached() OVERRIDE;
46 virtual void InspectElement(int x, int y) OVERRIDE;
48 virtual std::string GetId() OVERRIDE;
50 virtual RenderViewHost* GetRenderViewHost() OVERRIDE;
52 virtual void DisconnectRenderViewHost() OVERRIDE;
54 virtual void ConnectRenderViewHost(RenderViewHost* rvh) OVERRIDE;
56 protected:
57 DevToolsAgentHostImpl();
58 virtual ~DevToolsAgentHostImpl();
60 void NotifyCloseListener();
62 private:
63 CloseListener* close_listener_;
64 const std::string id_;
67 } // namespace content
69 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_