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 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ |
6 #define HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ |
7 | 7 |
8 #include "content/public/browser/devtools_manager_delegate.h" | |
9 | |
10 #include <map> | 8 #include <map> |
11 #include <memory> | 9 #include <memory> |
12 #include <string> | 10 #include <string> |
13 | 11 |
| 12 #include "base/callback_forward.h" |
14 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
15 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "content/public/browser/devtools_manager_delegate.h" |
16 | 16 |
17 namespace headless { | 17 namespace headless { |
18 class HeadlessBrowserImpl; | 18 class HeadlessBrowserImpl; |
19 | 19 |
20 class HeadlessDevToolsManagerDelegate | 20 class HeadlessDevToolsManagerDelegate |
21 : public content::DevToolsManagerDelegate { | 21 : public content::DevToolsManagerDelegate { |
22 public: | 22 public: |
23 explicit HeadlessDevToolsManagerDelegate( | 23 explicit HeadlessDevToolsManagerDelegate( |
24 base::WeakPtr<HeadlessBrowserImpl> browser); | 24 base::WeakPtr<HeadlessBrowserImpl> browser); |
25 ~HeadlessDevToolsManagerDelegate() override; | 25 ~HeadlessDevToolsManagerDelegate() override; |
(...skipping 15 matching lines...) Expand all Loading... |
41 const base::DictionaryValue* params); | 41 const base::DictionaryValue* params); |
42 std::unique_ptr<base::DictionaryValue> CreateBrowserContext( | 42 std::unique_ptr<base::DictionaryValue> CreateBrowserContext( |
43 int command_id, | 43 int command_id, |
44 const base::DictionaryValue* params); | 44 const base::DictionaryValue* params); |
45 std::unique_ptr<base::DictionaryValue> DisposeBrowserContext( | 45 std::unique_ptr<base::DictionaryValue> DisposeBrowserContext( |
46 int command_id, | 46 int command_id, |
47 const base::DictionaryValue* params); | 47 const base::DictionaryValue* params); |
48 | 48 |
49 base::WeakPtr<HeadlessBrowserImpl> browser_; | 49 base::WeakPtr<HeadlessBrowserImpl> browser_; |
50 | 50 |
51 using CommandMemberFnPtr = std::unique_ptr<base::DictionaryValue> ( | 51 using CommandMemberCallback = |
52 HeadlessDevToolsManagerDelegate::*)(int command_id, | 52 base::Callback<std::unique_ptr<base::DictionaryValue>( |
53 const base::DictionaryValue* params); | 53 int command_id, |
54 | 54 const base::DictionaryValue* params)>; |
55 std::map<std::string, CommandMemberFnPtr> command_map_; | 55 std::map<std::string, CommandMemberCallback> command_map_; |
56 }; | 56 }; |
57 | 57 |
58 } // namespace headless | 58 } // namespace headless |
59 | 59 |
60 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ | 60 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ |
OLD | NEW |