Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: headless/lib/browser/headless_devtools_manager_delegate.h

Issue 2119063002: Add commands to manage tabs and contexts to Browser Domain (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix name Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_devtools_client_impl.cc ('k') | headless/lib/browser/headless_devtools_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698