• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 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=2c1533712df282ba8ab092a2b42e69296c4d4771$
13 //
14 
15 #include "libcef_dll/ctocpp/frame_handler_ctocpp.h"
16 #include "libcef_dll/cpptoc/browser_cpptoc.h"
17 #include "libcef_dll/cpptoc/frame_cpptoc.h"
18 #include "libcef_dll/shutdown_checker.h"
19 
20 // VIRTUAL METHODS - Body may be edited by hand.
21 
22 NO_SANITIZE("cfi-icall")
OnFrameCreated(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> frame)23 void CefFrameHandlerCToCpp::OnFrameCreated(CefRefPtr<CefBrowser> browser,
24                                            CefRefPtr<CefFrame> frame) {
25   shutdown_checker::AssertNotShutdown();
26 
27   cef_frame_handler_t* _struct = GetStruct();
28   if (CEF_MEMBER_MISSING(_struct, on_frame_created))
29     return;
30 
31   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
32 
33   // Verify param: browser; type: refptr_diff
34   DCHECK(browser.get());
35   if (!browser.get())
36     return;
37   // Verify param: frame; type: refptr_diff
38   DCHECK(frame.get());
39   if (!frame.get())
40     return;
41 
42   // Execute
43   _struct->on_frame_created(_struct, CefBrowserCppToC::Wrap(browser),
44                             CefFrameCppToC::Wrap(frame));
45 }
46 
47 NO_SANITIZE("cfi-icall")
OnFrameAttached(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> frame,bool reattached)48 void CefFrameHandlerCToCpp::OnFrameAttached(CefRefPtr<CefBrowser> browser,
49                                             CefRefPtr<CefFrame> frame,
50                                             bool reattached) {
51   shutdown_checker::AssertNotShutdown();
52 
53   cef_frame_handler_t* _struct = GetStruct();
54   if (CEF_MEMBER_MISSING(_struct, on_frame_attached))
55     return;
56 
57   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
58 
59   // Verify param: browser; type: refptr_diff
60   DCHECK(browser.get());
61   if (!browser.get())
62     return;
63   // Verify param: frame; type: refptr_diff
64   DCHECK(frame.get());
65   if (!frame.get())
66     return;
67 
68   // Execute
69   _struct->on_frame_attached(_struct, CefBrowserCppToC::Wrap(browser),
70                              CefFrameCppToC::Wrap(frame), reattached);
71 }
72 
73 NO_SANITIZE("cfi-icall")
OnFrameDetached(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> frame)74 void CefFrameHandlerCToCpp::OnFrameDetached(CefRefPtr<CefBrowser> browser,
75                                             CefRefPtr<CefFrame> frame) {
76   shutdown_checker::AssertNotShutdown();
77 
78   cef_frame_handler_t* _struct = GetStruct();
79   if (CEF_MEMBER_MISSING(_struct, on_frame_detached))
80     return;
81 
82   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
83 
84   // Verify param: browser; type: refptr_diff
85   DCHECK(browser.get());
86   if (!browser.get())
87     return;
88   // Verify param: frame; type: refptr_diff
89   DCHECK(frame.get());
90   if (!frame.get())
91     return;
92 
93   // Execute
94   _struct->on_frame_detached(_struct, CefBrowserCppToC::Wrap(browser),
95                              CefFrameCppToC::Wrap(frame));
96 }
97 
98 NO_SANITIZE("cfi-icall")
OnMainFrameChanged(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> old_frame,CefRefPtr<CefFrame> new_frame)99 void CefFrameHandlerCToCpp::OnMainFrameChanged(CefRefPtr<CefBrowser> browser,
100                                                CefRefPtr<CefFrame> old_frame,
101                                                CefRefPtr<CefFrame> new_frame) {
102   shutdown_checker::AssertNotShutdown();
103 
104   cef_frame_handler_t* _struct = GetStruct();
105   if (CEF_MEMBER_MISSING(_struct, on_main_frame_changed))
106     return;
107 
108   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
109 
110   // Verify param: browser; type: refptr_diff
111   DCHECK(browser.get());
112   if (!browser.get())
113     return;
114   // Unverified params: old_frame, new_frame
115 
116   // Execute
117   _struct->on_main_frame_changed(_struct, CefBrowserCppToC::Wrap(browser),
118                                  CefFrameCppToC::Wrap(old_frame),
119                                  CefFrameCppToC::Wrap(new_frame));
120 }
121 
122 // CONSTRUCTOR - Do not edit by hand.
123 
CefFrameHandlerCToCpp()124 CefFrameHandlerCToCpp::CefFrameHandlerCToCpp() {}
125 
126 // DESTRUCTOR - Do not edit by hand.
127 
~CefFrameHandlerCToCpp()128 CefFrameHandlerCToCpp::~CefFrameHandlerCToCpp() {
129   shutdown_checker::AssertNotShutdown();
130 }
131 
132 template <>
133 cef_frame_handler_t*
134 CefCToCppRefCounted<CefFrameHandlerCToCpp,
135                     CefFrameHandler,
UnwrapDerived(CefWrapperType type,CefFrameHandler * c)136                     cef_frame_handler_t>::UnwrapDerived(CefWrapperType type,
137                                                         CefFrameHandler* c) {
138   NOTREACHED() << "Unexpected class type: " << type;
139   return nullptr;
140 }
141 
142 template <>
143 CefWrapperType CefCToCppRefCounted<CefFrameHandlerCToCpp,
144                                    CefFrameHandler,
145                                    cef_frame_handler_t>::kWrapperType =
146     WT_FRAME_HANDLER;
147