| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_SERVICE_H_ | 5 #ifndef CONTENT_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_SERVICE_H_ |
| 6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_SERVICE_H_ | 6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "content/browser/debugger/devtools_remote.h" | 10 #include "content/browser/debugger/devtools_remote.h" |
| 11 | 11 |
| 12 class DevToolsRemoteMessage; | 12 class DevToolsRemoteMessage; |
| 13 class DevToolsProtocolHandler; | 13 class DevToolsProtocolHandler; |
| 14 |
| 15 namespace base { |
| 14 class DictionaryValue; | 16 class DictionaryValue; |
| 15 class Value; | 17 } |
| 16 | 18 |
| 17 // Contains constants for DevToolsRemoteService tool protocol commands. | 19 // Contains constants for DevToolsRemoteService tool protocol commands. |
| 18 struct DevToolsRemoteServiceCommand { | 20 struct DevToolsRemoteServiceCommand { |
| 19 static const char kPing[]; | 21 static const char kPing[]; |
| 20 static const char kVersion[]; | 22 static const char kVersion[]; |
| 21 static const char kListTabs[]; | 23 static const char kListTabs[]; |
| 22 }; | 24 }; |
| 23 | 25 |
| 24 // Handles Chrome remote debugger protocol service commands. | 26 // Handles Chrome remote debugger protocol service commands. |
| 25 class DevToolsRemoteService : public DevToolsRemoteListener { | 27 class DevToolsRemoteService : public DevToolsRemoteListener { |
| 26 public: | 28 public: |
| 27 explicit DevToolsRemoteService(DevToolsProtocolHandler* delegate); | 29 explicit DevToolsRemoteService(DevToolsProtocolHandler* delegate); |
| 28 | 30 |
| 29 // DevToolsRemoteListener interface | 31 // DevToolsRemoteListener interface |
| 30 virtual void HandleMessage(const DevToolsRemoteMessage& message); | 32 virtual void HandleMessage(const DevToolsRemoteMessage& message); |
| 31 virtual void OnConnectionLost() {} | 33 virtual void OnConnectionLost() {} |
| 32 | 34 |
| 33 static const char kToolName[]; | 35 static const char kToolName[]; |
| 34 | 36 |
| 35 private: | 37 private: |
| 36 // Operation result returned in the "result" field. | 38 // Operation result returned in the "result" field. |
| 37 struct Result { | 39 struct Result { |
| 38 static const int kOk = 0; | 40 static const int kOk = 0; |
| 39 static const int kUnknownCommand = 1; | 41 static const int kUnknownCommand = 1; |
| 40 }; | 42 }; |
| 41 virtual ~DevToolsRemoteService(); | 43 virtual ~DevToolsRemoteService(); |
| 42 void ProcessJson(DictionaryValue* json, const DevToolsRemoteMessage& message); | 44 void ProcessJson(base::DictionaryValue* json, |
| 45 const DevToolsRemoteMessage& message); |
| 43 DevToolsProtocolHandler* delegate_; | 46 DevToolsProtocolHandler* delegate_; |
| 44 DISALLOW_COPY_AND_ASSIGN(DevToolsRemoteService); | 47 DISALLOW_COPY_AND_ASSIGN(DevToolsRemoteService); |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_SERVICE_H_ | 50 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_SERVICE_H_ |
| OLD | NEW |