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

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a2b3912f8188f19f3d5109aec1b1d03227e31429$
// $hash=bf895e77fc8bfc4760c17e2ec32d74a5cd9a91a1$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_DELEGATE_CAPI_H_
@ -48,6 +48,16 @@ extern "C" {
struct _cef_menu_button_t;
///
// MenuButton pressed lock is released when this object is destroyed.
///
typedef struct _cef_menu_button_pressed_lock_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
} cef_menu_button_pressed_lock_t;
///
// Implement this structure to handle MenuButton events. The functions of this
// structure will be called on the browser process UI thread unless otherwise
@ -61,12 +71,15 @@ typedef struct _cef_menu_button_delegate_t {
///
// Called when |button| is pressed. Call cef_menu_button_t::show_menu() to
// show the resulting menu at |screen_point|.
// show a popup menu at |screen_point|. When showing a custom popup such as a
// window keep a reference to |button_pressed_lock| until the popup is hidden
// to maintain the pressed button state.
///
void(CEF_CALLBACK* on_menu_button_pressed)(
struct _cef_menu_button_delegate_t* self,
struct _cef_menu_button_t* menu_button,
const cef_point_t* screen_point);
const cef_point_t* screen_point,
struct _cef_menu_button_pressed_lock_t* button_pressed_lock);
} cef_menu_button_delegate_t;
#ifdef __cplusplus

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=e4957abc4c3b80b9f324d74d2c8c6aa2632c52d9$
// $hash=5664bec47eefda37f8adb7bd153620559116f4a9$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
@ -73,6 +73,20 @@ typedef struct _cef_window_delegate_t {
void(CEF_CALLBACK* on_window_destroyed)(struct _cef_window_delegate_t* self,
struct _cef_window_t* window);
///
// Return the parent for |window| or NULL if the |window| does not have a
// parent. Windows with parents will not get a taskbar button. Set |is_menu|
// to true (1) if |window| will be displayed as a menu, in which case it will
// not be clipped to the parent window bounds. Set |can_activate_menu| to
// false (0) if |is_menu| is true (1) and |window| should not be activated
// (given keyboard focus) when displayed.
///
struct _cef_window_t*(CEF_CALLBACK* get_parent_window)(
struct _cef_window_delegate_t* self,
struct _cef_window_t* window,
int* is_menu,
int* can_activate_menu);
///
// Return true (1) if |window| should be created without a frame or title bar.
// The window will be resizable if can_resize() returns true (1). Use