• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=cbd8868643e361e9e9cd94bf2fadf91c2b7f4e47$
13 //
14 
15 #include "libcef_dll/ctocpp/focus_handler_ctocpp.h"
16 #include "libcef_dll/cpptoc/browser_cpptoc.h"
17 #include "libcef_dll/shutdown_checker.h"
18 
19 // VIRTUAL METHODS - Body may be edited by hand.
20 
21 NO_SANITIZE("cfi-icall")
OnTakeFocus(CefRefPtr<CefBrowser> browser,bool next)22 void CefFocusHandlerCToCpp::OnTakeFocus(CefRefPtr<CefBrowser> browser,
23                                         bool next) {
24   shutdown_checker::AssertNotShutdown();
25 
26   cef_focus_handler_t* _struct = GetStruct();
27   if (CEF_MEMBER_MISSING(_struct, on_take_focus))
28     return;
29 
30   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
31 
32   // Verify param: browser; type: refptr_diff
33   DCHECK(browser.get());
34   if (!browser.get())
35     return;
36 
37   // Execute
38   _struct->on_take_focus(_struct, CefBrowserCppToC::Wrap(browser), next);
39 }
40 
41 NO_SANITIZE("cfi-icall")
OnSetFocus(CefRefPtr<CefBrowser> browser,FocusSource source)42 bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr<CefBrowser> browser,
43                                        FocusSource source) {
44   shutdown_checker::AssertNotShutdown();
45 
46   cef_focus_handler_t* _struct = GetStruct();
47   if (CEF_MEMBER_MISSING(_struct, on_set_focus))
48     return false;
49 
50   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
51 
52   // Verify param: browser; type: refptr_diff
53   DCHECK(browser.get());
54   if (!browser.get())
55     return false;
56 
57   // Execute
58   int _retval =
59       _struct->on_set_focus(_struct, CefBrowserCppToC::Wrap(browser), source);
60 
61   // Return type: bool
62   return _retval ? true : false;
63 }
64 
65 NO_SANITIZE("cfi-icall")
OnGotFocus(CefRefPtr<CefBrowser> browser)66 void CefFocusHandlerCToCpp::OnGotFocus(CefRefPtr<CefBrowser> browser) {
67   shutdown_checker::AssertNotShutdown();
68 
69   cef_focus_handler_t* _struct = GetStruct();
70   if (CEF_MEMBER_MISSING(_struct, on_got_focus))
71     return;
72 
73   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
74 
75   // Verify param: browser; type: refptr_diff
76   DCHECK(browser.get());
77   if (!browser.get())
78     return;
79 
80   // Execute
81   _struct->on_got_focus(_struct, CefBrowserCppToC::Wrap(browser));
82 }
83 
84 // CONSTRUCTOR - Do not edit by hand.
85 
CefFocusHandlerCToCpp()86 CefFocusHandlerCToCpp::CefFocusHandlerCToCpp() {}
87 
88 // DESTRUCTOR - Do not edit by hand.
89 
~CefFocusHandlerCToCpp()90 CefFocusHandlerCToCpp::~CefFocusHandlerCToCpp() {
91   shutdown_checker::AssertNotShutdown();
92 }
93 
94 template <>
95 cef_focus_handler_t*
96 CefCToCppRefCounted<CefFocusHandlerCToCpp,
97                     CefFocusHandler,
UnwrapDerived(CefWrapperType type,CefFocusHandler * c)98                     cef_focus_handler_t>::UnwrapDerived(CefWrapperType type,
99                                                         CefFocusHandler* c) {
100   NOTREACHED() << "Unexpected class type: " << type;
101   return nullptr;
102 }
103 
104 template <>
105 CefWrapperType CefCToCppRefCounted<CefFocusHandlerCToCpp,
106                                    CefFocusHandler,
107                                    cef_focus_handler_t>::kWrapperType =
108     WT_FOCUS_HANDLER;
109