| 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 } | 12 } |
| 12 | 13 |
| 13 SchemaHandler::~SchemaHandler() { | 14 SchemaHandler::~SchemaHandler() { |
| 14 } | 15 } |
| 15 | 16 |
| 16 void SchemaHandler::Wire(UberDispatcher* dispatcher) { | 17 void SchemaHandler::Wire(UberDispatcher* dispatcher) { |
| 17 Schema::Dispatcher::wire(dispatcher, this); | 18 Schema::Dispatcher::wire(dispatcher, this); |
| 18 } | 19 } |
| 19 | 20 |
| 20 Response SchemaHandler::Disable() { | |
| 21 return Response::OK(); | |
| 22 } | |
| 23 | |
| 24 Response SchemaHandler::GetDomains( | 21 Response SchemaHandler::GetDomains( |
| 25 std::unique_ptr<protocol::Array<Schema::Domain>>* domains) { | 22 std::unique_ptr<protocol::Array<Schema::Domain>>* domains) { |
| 26 // 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. |
| 27 static const char kVersion[] = "1.2"; | 24 static const char kVersion[] = "1.2"; |
| 28 static const char* kDomains[] = { | 25 static const char* kDomains[] = { |
| 29 "Inspector", "Memory", "Page", "Rendering", "Emulation", "Security", | 26 "Inspector", "Memory", "Page", "Rendering", "Emulation", "Security", |
| 30 "Network", "Database", "IndexedDB", "CacheStorage", "DOMStorage", "CSS", | 27 "Network", "Database", "IndexedDB", "CacheStorage", "DOMStorage", "CSS", |
| 31 "ApplicationCache", "DOM", "IO", "DOMDebugger", "ServiceWorker", | 28 "ApplicationCache", "DOM", "IO", "DOMDebugger", "ServiceWorker", |
| 32 "Input", "LayerTree", "DeviceOrientation", "Tracing", "Animation", | 29 "Input", "LayerTree", "DeviceOrientation", "Tracing", "Animation", |
| 33 "Accessibility", "Storage", "Log", "Runtime", "Debugger", | 30 "Accessibility", "Storage", "Log", "Runtime", "Debugger", |
| 34 "Profiler", "HeapProfiler", "Schema", "Target" | 31 "Profiler", "HeapProfiler", "Schema", "Target" |
| 35 }; | 32 }; |
| 36 *domains = protocol::Array<Schema::Domain>::create(); | 33 *domains = protocol::Array<Schema::Domain>::create(); |
| 37 for (size_t i = 0; i < arraysize(kDomains); ++i) { | 34 for (size_t i = 0; i < arraysize(kDomains); ++i) { |
| 38 (*domains)->addItem(Schema::Domain::Create() | 35 (*domains)->addItem(Schema::Domain::Create() |
| 39 .SetName(kDomains[i]) | 36 .SetName(kDomains[i]) |
| 40 .SetVersion(kVersion) | 37 .SetVersion(kVersion) |
| 41 .Build()); | 38 .Build()); |
| 42 } | 39 } |
| 43 return Response::OK(); | 40 return Response::OK(); |
| 44 } | 41 } |
| 45 | 42 |
| 46 } // namespace protocol | 43 } // namespace protocol |
| 47 } // namespace content | 44 } // namespace content |
| OLD | NEW |