OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_FRONTEND_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_FRONTEND_H_ |
| 7 |
| 8 #include "content/browser/devtools/devtools_protocol.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 class DevToolsProtocolFrontend { |
| 13 public: |
| 14 typedef base::Callback<void(const std::string& event, |
| 15 base::DictionaryValue* params)> EventCallback; |
| 16 enum ResponseStatus { |
| 17 RESPONSE_STATUS_FALLTHROUGH, |
| 18 RESPONSE_STATUS_OK, |
| 19 RESPONSE_STATUS_INVALID_PARAMS, |
| 20 RESPONSE_STATUS_INTERNAL_ERROR, |
| 21 RESPONSE_STATUS_SERVER_ERROR, |
| 22 }; |
| 23 |
| 24 struct Response { |
| 25 public: |
| 26 static Response FallThrough(); |
| 27 static Response OK(); |
| 28 static Response InvalidParams(const std::string& message); |
| 29 static Response InternalError(const std::string& message); |
| 30 static Response ServerError(const std::string& message); |
| 31 |
| 32 ResponseStatus status(); |
| 33 const std::string& message(); |
| 34 private: |
| 35 ResponseStatus status_; |
| 36 std::string message_; |
| 37 }; |
| 38 |
| 39 protected: |
| 40 explicit DevToolsProtocolFrontend(const EventCallback& event_callback); |
| 41 virtual ~DevToolsProtocolFrontend(); |
| 42 |
| 43 void SendNotification(const std::string& method, |
| 44 base::DictionaryValue* params); |
| 45 |
| 46 private: |
| 47 EventCallback event_callback_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(DevToolsProtocolFrontend); |
| 50 }; |
| 51 |
| 52 } // namespace content |
| 53 |
| 54 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_FRONTEND_H_ |
OLD | NEW |