OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ | 5 #ifndef COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ |
6 #define COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ | 6 #define COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "components/ui_devtools/DOM.h" | 10 #include "components/ui_devtools/DOM.h" |
11 #include "components/ui_devtools/Forward.h" | 11 #include "components/ui_devtools/Forward.h" |
12 #include "components/ui_devtools/Protocol.h" | 12 #include "components/ui_devtools/Protocol.h" |
13 #include "components/ui_devtools/devtools_base_agent.h" | 13 #include "components/ui_devtools/devtools_base_agent.h" |
| 14 #include "components/ui_devtools/devtools_export.h" |
14 | 15 |
15 namespace ui { | 16 namespace ui_devtools { |
16 namespace devtools { | |
17 | 17 |
18 class UiDevToolsServer; | 18 class UiDevToolsServer; |
19 | 19 |
20 // Every UI component that wants to be inspectable must instantiate | 20 // Every UI component that wants to be inspectable must instantiate |
21 // this class and attach the corresponding backends/frontends (i.e: DOM, CSS, | 21 // this class and attach the corresponding backends/frontends (i.e: DOM, CSS, |
22 // etc). This client is then attached to the UiDevToolsServer and all messages | 22 // etc). This client is then attached to the UiDevToolsServer and all messages |
23 // from this client are sent over the web socket owned by the server. | 23 // from this client are sent over the web socket owned by the server. |
24 class UiDevToolsClient : public protocol::FrontendChannel { | 24 class UI_DEVTOOLS_EXPORT UiDevToolsClient : public protocol::FrontendChannel { |
25 public: | 25 public: |
26 static const int kNotConnected = -1; | 26 static const int kNotConnected = -1; |
27 | 27 |
28 UiDevToolsClient(const std::string& name, UiDevToolsServer* server); | 28 UiDevToolsClient(const std::string& name, UiDevToolsServer* server); |
29 ~UiDevToolsClient() override; | 29 ~UiDevToolsClient() override; |
30 | 30 |
31 void AddAgent(std::unique_ptr<UiDevToolsAgent> agent); | 31 void AddAgent(std::unique_ptr<UiDevToolsAgent> agent); |
32 void Disconnect(); | 32 void Disconnect(); |
33 void Dispatch(const std::string& data); | 33 void Dispatch(const std::string& data); |
34 | 34 |
(...skipping 15 matching lines...) Expand all Loading... |
50 std::string name_; | 50 std::string name_; |
51 int connection_id_; | 51 int connection_id_; |
52 | 52 |
53 std::vector<std::unique_ptr<UiDevToolsAgent>> agents_; | 53 std::vector<std::unique_ptr<UiDevToolsAgent>> agents_; |
54 protocol::UberDispatcher dispatcher_; | 54 protocol::UberDispatcher dispatcher_; |
55 UiDevToolsServer* server_; | 55 UiDevToolsServer* server_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(UiDevToolsClient); | 57 DISALLOW_COPY_AND_ASSIGN(UiDevToolsClient); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace devtools | 60 } // namespace ui_devtools |
61 } // namespace ui | |
62 | 61 |
63 #endif // COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ | 62 #endif // COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ |
OLD | NEW |