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 { |
blundell
2017/06/19 13:33:00
the namespace for this code should now be ui_devto
thanhph
2017/06/20 17:40:28
Done. I use ui_devtools namespace for all relevant
| |
16 namespace devtools { | 17 namespace devtools { |
17 | 18 |
18 class UiDevToolsServer; | 19 class UiDevToolsServer; |
19 | 20 |
20 // Every UI component that wants to be inspectable must instantiate | 21 // Every UI component that wants to be inspectable must instantiate |
21 // this class and attach the corresponding backends/frontends (i.e: DOM, CSS, | 22 // 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 | 23 // 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. | 24 // from this client are sent over the web socket owned by the server. |
24 class UiDevToolsClient : public protocol::FrontendChannel { | 25 class UI_DEVTOOLS_EXPORT UiDevToolsClient : public protocol::FrontendChannel { |
25 public: | 26 public: |
26 static const int kNotConnected = -1; | 27 static const int kNotConnected = -1; |
27 | 28 |
28 UiDevToolsClient(const std::string& name, UiDevToolsServer* server); | 29 UiDevToolsClient(const std::string& name, UiDevToolsServer* server); |
29 ~UiDevToolsClient() override; | 30 ~UiDevToolsClient() override; |
30 | 31 |
31 void AddAgent(std::unique_ptr<UiDevToolsAgent> agent); | 32 void AddAgent(std::unique_ptr<UiDevToolsAgent> agent); |
32 void Disconnect(); | 33 void Disconnect(); |
33 void Dispatch(const std::string& data); | 34 void Dispatch(const std::string& data); |
34 | 35 |
(...skipping 19 matching lines...) Expand all Loading... | |
54 protocol::UberDispatcher dispatcher_; | 55 protocol::UberDispatcher dispatcher_; |
55 UiDevToolsServer* server_; | 56 UiDevToolsServer* server_; |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(UiDevToolsClient); | 58 DISALLOW_COPY_AND_ASSIGN(UiDevToolsClient); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace devtools | 61 } // namespace devtools |
61 } // namespace ui | 62 } // namespace ui |
62 | 63 |
63 #endif // COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ | 64 #endif // COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ |
OLD | NEW |