| 38 | } |
| 39 | |
| 40 | struct DevToolsLifeSpan : CefRefCount<cef_life_span_handler_t> |
| 41 | { |
| 42 | int parent_id_; |
| 43 | |
| 44 | DevToolsLifeSpan(int parent_id) |
| 45 | : CefRefCount(this) |
| 46 | , parent_id_(parent_id) |
| 47 | { |
| 48 | cef_bind_method(DevToolsLifeSpan, on_after_created); |
| 49 | cef_bind_method(DevToolsLifeSpan, on_before_close); |
| 50 | } |
| 51 | |
| 52 | void _on_after_created(cef_browser_t* browser) |
| 53 | { |
| 54 | auto host = browser->get_host(browser); |
| 55 | |
| 56 | // Save devtools handle. |
| 57 | void *window = (void *)host->get_window_handle(host); |
| 58 | devtools_map_.emplace(parent_id_, window); |
| 59 | |
| 60 | // Set initial zoom level |
| 61 | double zoom_level = window::get_scaling(window) - 1.0; |
| 62 | host->set_zoom_level(host, zoom_level); |
| 63 | |
| 64 | setup_devtools_window(window); |
| 65 | host->base.release(&host->base); |
| 66 | }; |
| 67 | |
| 68 | void _on_before_close(cef_browser_t* browser) |
| 69 | { |
| 70 | // Remove devtools handle. |
| 71 | devtools_map_.erase(parent_id_); |
| 72 | }; |
| 73 | }; |
| 74 | |
| 75 | struct DevToolsKeyboardHandler : CefRefCount<cef_keyboard_handler_t> |
| 76 | { |
nothing calls this directly
no outgoing calls
no test coverage detected