Add support for loading extensions (issue #1947)

- Add CefRequestContext::LoadExtension, CefExtension, CefExtensionHandler and
  related methods/interfaces.
- Add chrome://extensions-support that lists supported Chrome APIs.
- Add CefBrowserHost::SetAutoResizeEnabled and CefDisplayHandler::OnAutoResize
  to support browser resize based on preferred web contents size.
- views: Add support for custom CefMenuButton popups.
- cefclient: Run with `--load-extension=set_page_color` command-line flag for
  an extension loading example. Add `--use-views` on Windows and Linux for an
  even better example.
This commit is contained in:
Marshall Greenblatt
2017-08-03 18:55:19 -04:00
parent 5b12134a45
commit 9cff99dc4e
178 changed files with 10360 additions and 650 deletions

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=9cf5d66da05ef9e423995bc8f527ef1315812134$
// $hash=80a92fb23bc01d46903ea4e2076950a4ffe07b18$
//
#include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h"
@ -56,6 +56,51 @@ window_delegate_on_window_destroyed(struct _cef_window_delegate_t* self,
CefWindowCToCpp::Wrap(window));
}
cef_window_t* CEF_CALLBACK
window_delegate_get_parent_window(struct _cef_window_delegate_t* self,
cef_window_t* window,
int* is_menu,
int* can_activate_menu) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Verify param: window; type: refptr_diff
DCHECK(window);
if (!window)
return NULL;
// Verify param: is_menu; type: bool_byaddr
DCHECK(is_menu);
if (!is_menu)
return NULL;
// Verify param: can_activate_menu; type: bool_byaddr
DCHECK(can_activate_menu);
if (!can_activate_menu)
return NULL;
// Translate param: is_menu; type: bool_byaddr
bool is_menuBool = (is_menu && *is_menu) ? true : false;
// Translate param: can_activate_menu; type: bool_byaddr
bool can_activate_menuBool =
(can_activate_menu && *can_activate_menu) ? true : false;
// Execute
CefRefPtr<CefWindow> _retval =
CefWindowDelegateCppToC::Get(self)->GetParentWindow(
CefWindowCToCpp::Wrap(window), &is_menuBool, &can_activate_menuBool);
// Restore param: is_menu; type: bool_byaddr
if (is_menu)
*is_menu = is_menuBool ? true : false;
// Restore param: can_activate_menu; type: bool_byaddr
if (can_activate_menu)
*can_activate_menu = can_activate_menuBool ? true : false;
// Return type: refptr_diff
return CefWindowCToCpp::Unwrap(_retval);
}
int CEF_CALLBACK
window_delegate_is_frameless(struct _cef_window_delegate_t* self,
cef_window_t* window) {
@ -392,6 +437,7 @@ void CEF_CALLBACK window_delegate_on_blur(struct _cef_view_delegate_t* self,
CefWindowDelegateCppToC::CefWindowDelegateCppToC() {
GetStruct()->on_window_created = window_delegate_on_window_created;
GetStruct()->on_window_destroyed = window_delegate_on_window_destroyed;
GetStruct()->get_parent_window = window_delegate_get_parent_window;
GetStruct()->is_frameless = window_delegate_is_frameless;
GetStruct()->can_resize = window_delegate_can_resize;
GetStruct()->can_maximize = window_delegate_can_maximize;