1 // Copyright (c) 2021 The Chromium Embedded Framework Authors. All rights 2 // reserved. Use of this source code is governed by a BSD-style license that 3 // can be found in the LICENSE file. 4 // 5 // --------------------------------------------------------------------------- 6 // 7 // This file was generated by the CEF translator tool. If making changes by 8 // hand only do so within the body of existing method and function 9 // implementations. See the translator.README.txt file in the tools directory 10 // for more information. 11 // 12 // $hash=fb56495a48efa0319e4ed8789305c5106707e7b6$ 13 // 14 15 #include "libcef_dll/cpptoc/focus_handler_cpptoc.h" 16 #include "libcef_dll/ctocpp/browser_ctocpp.h" 17 #include "libcef_dll/shutdown_checker.h" 18 19 namespace { 20 21 // MEMBER FUNCTIONS - Body may be edited by hand. 22 focus_handler_on_take_focus(struct _cef_focus_handler_t * self,cef_browser_t * browser,int next)23 void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self, 24 cef_browser_t* browser, 25 int next) { 26 shutdown_checker::AssertNotShutdown(); 27 28 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 29 30 DCHECK(self); 31 if (!self) 32 return; 33 // Verify param: browser; type: refptr_diff 34 DCHECK(browser); 35 if (!browser) 36 return; 37 38 // Execute 39 CefFocusHandlerCppToC::Get(self)->OnTakeFocus(CefBrowserCToCpp::Wrap(browser), 40 next ? true : false); 41 } 42 focus_handler_on_set_focus(struct _cef_focus_handler_t * self,cef_browser_t * browser,cef_focus_source_t source)43 int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self, 44 cef_browser_t* browser, 45 cef_focus_source_t source) { 46 shutdown_checker::AssertNotShutdown(); 47 48 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 49 50 DCHECK(self); 51 if (!self) 52 return 0; 53 // Verify param: browser; type: refptr_diff 54 DCHECK(browser); 55 if (!browser) 56 return 0; 57 58 // Execute 59 bool _retval = CefFocusHandlerCppToC::Get(self)->OnSetFocus( 60 CefBrowserCToCpp::Wrap(browser), source); 61 62 // Return type: bool 63 return _retval; 64 } 65 focus_handler_on_got_focus(struct _cef_focus_handler_t * self,cef_browser_t * browser)66 void CEF_CALLBACK focus_handler_on_got_focus(struct _cef_focus_handler_t* self, 67 cef_browser_t* browser) { 68 shutdown_checker::AssertNotShutdown(); 69 70 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 71 72 DCHECK(self); 73 if (!self) 74 return; 75 // Verify param: browser; type: refptr_diff 76 DCHECK(browser); 77 if (!browser) 78 return; 79 80 // Execute 81 CefFocusHandlerCppToC::Get(self)->OnGotFocus(CefBrowserCToCpp::Wrap(browser)); 82 } 83 84 } // namespace 85 86 // CONSTRUCTOR - Do not edit by hand. 87 CefFocusHandlerCppToC()88 CefFocusHandlerCppToC::CefFocusHandlerCppToC() { 89 GetStruct()->on_take_focus = focus_handler_on_take_focus; 90 GetStruct()->on_set_focus = focus_handler_on_set_focus; 91 GetStruct()->on_got_focus = focus_handler_on_got_focus; 92 } 93 94 // DESTRUCTOR - Do not edit by hand. 95 ~CefFocusHandlerCppToC()96 CefFocusHandlerCppToC::~CefFocusHandlerCppToC() { 97 shutdown_checker::AssertNotShutdown(); 98 } 99 100 template <> 101 CefRefPtr<CefFocusHandler> CefCppToCRefCounted< 102 CefFocusHandlerCppToC, 103 CefFocusHandler, UnwrapDerived(CefWrapperType type,cef_focus_handler_t * s)104 cef_focus_handler_t>::UnwrapDerived(CefWrapperType type, 105 cef_focus_handler_t* s) { 106 NOTREACHED() << "Unexpected class type: " << type; 107 return nullptr; 108 } 109 110 template <> 111 CefWrapperType CefCppToCRefCounted<CefFocusHandlerCppToC, 112 CefFocusHandler, 113 cef_focus_handler_t>::kWrapperType = 114 WT_FOCUS_HANDLER; 115