-
-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated to branch 3071 revision 1640 #35
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// CEF C API example | ||
// Project website: https://github.com/cztomczak/cefcapi | ||
|
||
#pragma once | ||
|
||
#include "handlers/cef_base.h" | ||
#include "include/capi/cef_app_capi.h" | ||
#include "include/capi/cef_life_span_handler_capi.h" | ||
|
||
// ---------------------------------------------------------------------------- | ||
// struct cef_life_span_handler_t | ||
// ---------------------------------------------------------------------------- | ||
|
||
/// | ||
// Implement this structure to handle events related to browser life span. The | ||
// functions of this structure will be called on the UI thread unless otherwise | ||
// indicated. | ||
/// | ||
|
||
// NOTE: There are many more callbacks in cef_life_span_handler, | ||
// but only on_before_close is implemented here. | ||
|
||
/// | ||
// Called just before a browser is destroyed. Release all references to the | ||
// browser object and do not attempt to execute any functions on the browser | ||
// object after this callback returns. This callback will be the last | ||
// notification that references |browser|. See do_close() documentation for | ||
// additional usage information. | ||
/// | ||
void CEF_CALLBACK on_before_close(struct _cef_life_span_handler_t* self, | ||
struct _cef_browser_t* browser) { | ||
DEBUG_CALLBACK("on_before_close\n"); | ||
// TODO: Check how many browsers do exist and quit message | ||
// loop only when last browser is closed. Otherwise | ||
// closing a popup window will exit app while main | ||
// window shouldn't be closed. | ||
cef_quit_message_loop(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This call should be commented out, otherwise popups will not work. In cef2go examples there are already explicit calls to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do |
||
} | ||
|
||
void initialize_cef_life_span_handler(cef_life_span_handler_t* handler) { | ||
DEBUG_CALLBACK("initialize_cef_life_span_handler\n"); | ||
handler->base.size = sizeof(cef_life_span_handler_t); | ||
initialize_cef_base_ref_counted((cef_base_ref_counted_t*)handler); | ||
// callbacks - there are many, but implementing only one | ||
handler->on_before_close = on_before_close; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make only one "Getting started on Windows" section and just add
a)
andb)
sublists for 32-bit and 64-bit. Something like:a) If using 32-bit ...
b) If using 64-bit ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do