| 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 <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "content/public/browser/devtools_manager_delegate.h" | 15 #include "content/public/browser/devtools_manager_delegate.h" |
| 16 #include "printing/features/features.h" |
| 17 |
| 18 #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
| 19 #include "headless/lib/browser/headless_print_manager.h" |
| 20 #endif |
| 16 | 21 |
| 17 namespace headless { | 22 namespace headless { |
| 18 class HeadlessBrowserImpl; | 23 class HeadlessBrowserImpl; |
| 19 | 24 |
| 25 #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
| 26 std::unique_ptr<base::DictionaryValue> ParsePrintSettings( |
| 27 int command_id, |
| 28 const base::DictionaryValue* params, |
| 29 printing::HeadlessPrintSettings* settings); |
| 30 #endif |
| 31 |
| 20 class HeadlessDevToolsManagerDelegate | 32 class HeadlessDevToolsManagerDelegate |
| 21 : public content::DevToolsManagerDelegate { | 33 : public content::DevToolsManagerDelegate { |
| 22 public: | 34 public: |
| 23 explicit HeadlessDevToolsManagerDelegate( | 35 explicit HeadlessDevToolsManagerDelegate( |
| 24 base::WeakPtr<HeadlessBrowserImpl> browser); | 36 base::WeakPtr<HeadlessBrowserImpl> browser); |
| 25 ~HeadlessDevToolsManagerDelegate() override; | 37 ~HeadlessDevToolsManagerDelegate() override; |
| 26 | 38 |
| 27 // DevToolsManagerDelegate implementation: | 39 // DevToolsManagerDelegate implementation: |
| 28 base::DictionaryValue* HandleCommand(content::DevToolsAgentHost* agent_host, | 40 base::DictionaryValue* HandleCommand(content::DevToolsAgentHost* agent_host, |
| 29 base::DictionaryValue* command) override; | 41 base::DictionaryValue* command) override; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 int command_id, | 76 int command_id, |
| 65 const base::DictionaryValue* params, | 77 const base::DictionaryValue* params, |
| 66 const CommandCallback& callback)>; | 78 const CommandCallback& callback)>; |
| 67 std::map<std::string, CommandMemberCallback> command_map_; | 79 std::map<std::string, CommandMemberCallback> command_map_; |
| 68 std::map<std::string, AsyncCommandMemberCallback> async_command_map_; | 80 std::map<std::string, AsyncCommandMemberCallback> async_command_map_; |
| 69 }; | 81 }; |
| 70 | 82 |
| 71 } // namespace headless | 83 } // namespace headless |
| 72 | 84 |
| 73 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ | 85 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ |
| OLD | NEW |