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