| Index: headless/lib/browser/headless_devtools_manager_delegate.h
|
| diff --git a/headless/lib/browser/headless_devtools_manager_delegate.h b/headless/lib/browser/headless_devtools_manager_delegate.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..58c069dfc72c3e83fb1045f0cb221a2014c7c1ee
|
| --- /dev/null
|
| +++ b/headless/lib/browser/headless_devtools_manager_delegate.h
|
| @@ -0,0 +1,55 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_
|
| +#define HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_
|
| +
|
| +#include "content/public/browser/devtools_manager_delegate.h"
|
| +
|
| +#include <map>
|
| +#include <memory>
|
| +#include <string>
|
| +
|
| +#include "base/values.h"
|
| +
|
| +namespace headless {
|
| +class HeadlessBrowserImpl;
|
| +class HeadlessBrowserContext;
|
| +class HeadlessWebContentsImpl;
|
| +
|
| +class HeadlessDevToolsManagerDelegate
|
| + : public content::DevToolsManagerDelegate {
|
| + public:
|
| + explicit HeadlessDevToolsManagerDelegate(HeadlessBrowserImpl* browser);
|
| + ~HeadlessDevToolsManagerDelegate() override;
|
| +
|
| + // DevToolsManagerDelegate implementation:
|
| + void Inspect(content::BrowserContext* browser_context,
|
| + content::DevToolsAgentHost* agent_host) override {}
|
| + void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host,
|
| + bool attached) override{};
|
| + base::DictionaryValue* HandleCommand(content::DevToolsAgentHost* agent_host,
|
| + base::DictionaryValue* command) override;
|
| +
|
| + private:
|
| + std::unique_ptr<base::Value> NewPage(const base::DictionaryValue* params);
|
| + std::unique_ptr<base::Value> ClosePage(const base::DictionaryValue* params);
|
| + std::unique_ptr<base::Value> NewBrowserContext(
|
| + const base::DictionaryValue* params);
|
| + std::unique_ptr<base::Value> CloseBrowserContext(
|
| + const base::DictionaryValue* params);
|
| +
|
| + HeadlessBrowserImpl* browser_; // Not owned.
|
| + std::map<std::string, std::unique_ptr<HeadlessBrowserContext>>
|
| + browser_context_map_;
|
| +
|
| + using CommandMemberFnPtr = std::unique_ptr<base::Value> (
|
| + HeadlessDevToolsManagerDelegate::*)(const base::DictionaryValue* params);
|
| +
|
| + std::map<std::string, CommandMemberFnPtr> command_map_;
|
| +};
|
| +
|
| +} // namespace headless
|
| +
|
| +#endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_
|
|
|