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_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_H_
8 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
12 class DevToolsProtocolHandler
{
14 using Response
= DevToolsProtocolClient::Response
;
15 using Notifier
= base::Callback
<void(const std::string
& message
)>;
17 DevToolsProtocolHandler(bool handle_generic_errors
,
18 const Notifier
& notifier
);
19 virtual ~DevToolsProtocolHandler();
21 scoped_ptr
<base::DictionaryValue
> ParseCommand(const std::string
& message
);
22 bool HandleCommand(scoped_ptr
<base::DictionaryValue
> command
);
24 DevToolsProtocolDispatcher
* dispatcher() { return &dispatcher_
; }
27 DevToolsProtocolClient client_
;
28 bool handle_generic_errors_
;
29 DevToolsProtocolDispatcher dispatcher_
;
32 } // namespace content
34 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_H_