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 #include "content/browser/devtools/protocol/schema_handler.h" | 5 #include "content/browser/devtools/protocol/schema_handler.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 namespace protocol { | 8 namespace protocol { |
9 | 9 |
10 SchemaHandler::SchemaHandler() | 10 SchemaHandler::SchemaHandler() |
11 : DevToolsDomainHandler(Schema::Metainfo::domainName) { | 11 : DevToolsDomainHandler(Schema::Metainfo::domainName) { |
12 } | 12 } |
13 | 13 |
14 SchemaHandler::~SchemaHandler() { | 14 SchemaHandler::~SchemaHandler() { |
15 } | 15 } |
16 | 16 |
17 void SchemaHandler::Wire(UberDispatcher* dispatcher) { | 17 void SchemaHandler::Wire(UberDispatcher* dispatcher) { |
18 Schema::Dispatcher::wire(dispatcher, this); | 18 Schema::Dispatcher::wire(dispatcher, this); |
19 } | 19 } |
20 | 20 |
21 Response SchemaHandler::GetDomains( | 21 Response SchemaHandler::GetDomains( |
22 std::unique_ptr<protocol::Array<Schema::Domain>>* domains) { | 22 std::unique_ptr<protocol::Array<Schema::Domain>>* domains) { |
23 // TODO(kozyatisnkiy): get this from the target instead of hardcoding a list. | 23 // TODO(kozyatisnkiy): get this from the target instead of hardcoding a list. |
24 static const char kVersion[] = "1.2"; | 24 static const char kVersion[] = "1.2"; |
25 static const char* kDomains[] = {"Inspector", | 25 static const char* kDomains[] = { |
26 "Memory", | 26 "Inspector", "Memory", "Page", "Emulation", |
27 "Page", | 27 "Security", "Network", "Database", "IndexedDB", |
28 "Emulation", | 28 "CacheStorage", "DOMStorage", "CSS", "ApplicationCache", |
29 "Security", | 29 "DOM", "IO", "DOMDebugger", "DOMSnapshot", |
30 "Network", | 30 "ServiceWorker", "Input", "LayerTree", "DeviceOrientation", |
31 "Database", | 31 "Tracing", "Animation", "Accessibility", "Storage", |
32 "IndexedDB", | 32 "Log", "Runtime", "Debugger", "Profiler", |
33 "CacheStorage", | 33 "HeapProfiler", "Schema", "Target", "Overlay"}; |
34 "DOMStorage", | |
35 "CSS", | |
36 "ApplicationCache", | |
37 "DOM", | |
38 "IO", | |
39 "DOMDebugger", | |
40 "ServiceWorker", | |
41 "Input", | |
42 "LayerTree", | |
43 "DeviceOrientation", | |
44 "Tracing", | |
45 "Animation", | |
46 "Accessibility", | |
47 "Storage", | |
48 "Log", | |
49 "Runtime", | |
50 "Debugger", | |
51 "Profiler", | |
52 "HeapProfiler", | |
53 "Schema", | |
54 "Target", | |
55 "Overlay"}; | |
56 *domains = protocol::Array<Schema::Domain>::create(); | 34 *domains = protocol::Array<Schema::Domain>::create(); |
57 for (size_t i = 0; i < arraysize(kDomains); ++i) { | 35 for (size_t i = 0; i < arraysize(kDomains); ++i) { |
58 (*domains)->addItem(Schema::Domain::Create() | 36 (*domains)->addItem(Schema::Domain::Create() |
59 .SetName(kDomains[i]) | 37 .SetName(kDomains[i]) |
60 .SetVersion(kVersion) | 38 .SetVersion(kVersion) |
61 .Build()); | 39 .Build()); |
62 } | 40 } |
63 return Response::OK(); | 41 return Response::OK(); |
64 } | 42 } |
65 | 43 |
66 } // namespace protocol | 44 } // namespace protocol |
67 } // namespace content | 45 } // namespace content |
OLD | NEW |