Sadrul Habib Chowdhury | ce2e9ff | 2017-09-26 23:07:05 | [diff] [blame] | 1 | // Copyright 2017 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 CHROME_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ |
| 6 | #define CHROME_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ |
| 7 | |
Pavel Feldman | 73b2202 | 2018-11-02 02:55:30 | [diff] [blame] | 8 | #include "base/containers/flat_set.h" |
Sadrul Habib Chowdhury | ce2e9ff | 2017-09-26 23:07:05 | [diff] [blame] | 9 | #include "chrome/browser/devtools/protocol/browser.h" |
| 10 | |
Sadrul Habib Chowdhury | ce2e9ff | 2017-09-26 23:07:05 | [diff] [blame] | 11 | class BrowserHandler : public protocol::Browser::Backend { |
| 12 | public: |
Pavel Feldman | c8aff83 | 2018-11-13 23:44:33 | [diff] [blame] | 13 | BrowserHandler(protocol::UberDispatcher* dispatcher, |
| 14 | const std::string& target_id); |
Peter Boström | 53c6c595 | 2021-09-17 09:41:26 | [diff] [blame^] | 15 | |
| 16 | BrowserHandler(const BrowserHandler&) = delete; |
| 17 | BrowserHandler& operator=(const BrowserHandler&) = delete; |
| 18 | |
Sadrul Habib Chowdhury | ce2e9ff | 2017-09-26 23:07:05 | [diff] [blame] | 19 | ~BrowserHandler() override; |
| 20 | |
| 21 | // Browser::Backend: |
| 22 | protocol::Response GetWindowForTarget( |
Pavel Feldman | c8aff83 | 2018-11-13 23:44:33 | [diff] [blame] | 23 | protocol::Maybe<std::string> target_id, |
Sadrul Habib Chowdhury | ce2e9ff | 2017-09-26 23:07:05 | [diff] [blame] | 24 | int* out_window_id, |
| 25 | std::unique_ptr<protocol::Browser::Bounds>* out_bounds) override; |
| 26 | protocol::Response GetWindowBounds( |
| 27 | int window_id, |
| 28 | std::unique_ptr<protocol::Browser::Bounds>* out_bounds) override; |
Andrey Lushnikov | c13356b4 | 2017-10-12 10:06:03 | [diff] [blame] | 29 | protocol::Response Close() override; |
Sadrul Habib Chowdhury | ce2e9ff | 2017-09-26 23:07:05 | [diff] [blame] | 30 | protocol::Response SetWindowBounds( |
| 31 | int window_id, |
| 32 | std::unique_ptr<protocol::Browser::Bounds> out_bounds) override; |
Pavel Feldman | 8358f76 | 2018-11-15 23:28:30 | [diff] [blame] | 33 | protocol::Response SetDockTile( |
| 34 | protocol::Maybe<std::string> label, |
| 35 | protocol::Maybe<protocol::Binary> image) override; |
Yuheng Huang | b08d9ec | 2020-10-23 02:04:22 | [diff] [blame] | 36 | protocol::Response ExecuteBrowserCommand( |
| 37 | const protocol::Browser::BrowserCommandId& command_id) override; |
Sadrul Habib Chowdhury | ce2e9ff | 2017-09-26 23:07:05 | [diff] [blame] | 38 | |
| 39 | private: |
Pavel Feldman | 73b2202 | 2018-11-02 02:55:30 | [diff] [blame] | 40 | base::flat_set<std::string> contexts_with_overridden_permissions_; |
Pavel Feldman | c8aff83 | 2018-11-13 23:44:33 | [diff] [blame] | 41 | std::string target_id_; |
Sadrul Habib Chowdhury | ce2e9ff | 2017-09-26 23:07:05 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | #endif // CHROME_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ |