ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / content / browser / devtools / worker_devtools_agent_host.h
blob34750edb94b09fd5d123f1929752aa345cfd3e64
1 // Copyright 2014 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_WORKER_DEVTOOLS_AGENT_HOST_H_
6 #define CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_
8 #include "content/browser/devtools/ipc_devtools_agent_host.h"
9 #include "content/browser/devtools/worker_devtools_manager.h"
10 #include "ipc/ipc_listener.h"
12 namespace content {
14 class BrowserContext;
15 class SharedWorkerInstance;
17 class WorkerDevToolsAgentHost : public IPCDevToolsAgentHost,
18 public IPC::Listener {
19 public:
20 typedef WorkerDevToolsManager::WorkerId WorkerId;
22 // DevToolsAgentHost override.
23 bool IsWorker() const override;
24 BrowserContext* GetBrowserContext() override;
26 // IPCDevToolsAgentHost implementation.
27 void SendMessageToAgent(IPC::Message* message) override;
28 void Attach() override;
29 void OnClientAttached() override;
30 void OnClientDetached() override;
32 // IPC::Listener implementation.
33 bool OnMessageReceived(const IPC::Message& msg) override;
35 void WorkerReadyForInspection();
36 void WorkerRestarted(WorkerId worker_id);
37 void WorkerDestroyed();
38 bool IsTerminated();
40 protected:
41 WorkerDevToolsAgentHost(WorkerId worker_id);
42 ~WorkerDevToolsAgentHost() override;
44 enum WorkerState {
45 WORKER_UNINSPECTED,
46 WORKER_INSPECTED,
47 WORKER_TERMINATED,
48 WORKER_PAUSED_FOR_DEBUG_ON_START,
49 WORKER_PAUSED_FOR_REATTACH,
52 void AttachToWorker();
53 void DetachFromWorker();
54 void WorkerCreated();
55 void OnDispatchOnInspectorFrontend(const DevToolsMessageChunk& message);
57 void set_state(WorkerState state) { state_ = state; }
58 const WorkerId& worker_id() const { return worker_id_; }
60 private:
61 friend class SharedWorkerDevToolsManagerTest;
63 WorkerState state_;
64 WorkerId worker_id_;
65 DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsAgentHost);
68 } // namespace content
70 #endif // CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_