Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ | |
| 6 #define HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ | |
| 7 | |
| 8 #include "content/public/browser/devtools_manager_delegate.h" | |
| 9 | |
| 10 #include <map> | |
| 11 #include <memory> | |
| 12 #include <string> | |
| 13 | |
| 14 #include "base/values.h" | |
| 15 | |
| 16 namespace headless { | |
| 17 class HeadlessBrowserImpl; | |
| 18 class HeadlessBrowserContext; | |
| 19 class HeadlessWebContentsImpl; | |
| 20 | |
| 21 class HeadlessDevToolsManagerDelegate | |
| 22 : public content::DevToolsManagerDelegate { | |
| 23 public: | |
| 24 explicit HeadlessDevToolsManagerDelegate(HeadlessBrowserImpl* browser); | |
| 25 ~HeadlessDevToolsManagerDelegate() override; | |
| 26 | |
| 27 // DevToolsManagerDelegate implementation: | |
| 28 void Inspect(content::BrowserContext* browser_context, | |
| 29 content::DevToolsAgentHost* agent_host) override {} | |
| 30 void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host, | |
| 31 bool attached) override{}; | |
| 32 base::DictionaryValue* HandleCommand(content::DevToolsAgentHost* agent_host, | |
| 33 base::DictionaryValue* command) override; | |
| 34 | |
| 35 private: | |
| 36 std::unique_ptr<base::Value> CreateTarget( | |
| 37 const base::DictionaryValue* params); | |
| 38 std::unique_ptr<base::Value> CloseTarget(const base::DictionaryValue* params); | |
| 39 std::unique_ptr<base::Value> CreateBrowserContext( | |
| 40 const base::DictionaryValue* params); | |
| 41 std::unique_ptr<base::Value> DisposeBrowserContext( | |
| 42 const base::DictionaryValue* params); | |
| 43 | |
| 44 HeadlessBrowserImpl* browser_; // Not owned. | |
| 45 std::map<std::string, std::unique_ptr<HeadlessBrowserContext>> | |
| 46 browser_context_map_; | |
| 47 | |
| 48 using CommandMemberFnPtr = std::unique_ptr<base::Value> ( | |
|
Lei Zhang
2017/03/29 01:09:11
I didn't see any discussion, so I'm curious why th
alex clarke (OOO till 29th)
2017/03/29 09:14:53
I'm probably missing some context, I suppose we co
| |
| 49 HeadlessDevToolsManagerDelegate::*)(const base::DictionaryValue* params); | |
| 50 | |
| 51 std::map<std::string, CommandMemberFnPtr> command_map_; | |
| 52 }; | |
| 53 | |
| 54 } // namespace headless | |
| 55 | |
| 56 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ | |
| OLD | NEW |