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

@ -42,6 +42,12 @@
class CefMenuButton;
///
// MenuButton pressed lock is released when this object is destroyed.
///
/*--cef(source=library)--*/
class CefMenuButtonPressedLock : public CefBaseRefCounted {};
///
// Implement this interface to handle MenuButton events. The methods of this
// class will be called on the browser process UI thread unless otherwise
@ -51,12 +57,16 @@ class CefMenuButton;
class CefMenuButtonDelegate : public CefButtonDelegate {
public:
///
// Called when |button| is pressed. Call CefMenuButton::ShowMenu() to show the
// resulting menu at |screen_point|.
// Called when |button| is pressed. Call CefMenuButton::ShowMenu() to 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.
///
/*--cef()--*/
virtual void OnMenuButtonPressed(CefRefPtr<CefMenuButton> menu_button,
const CefPoint& screen_point) = 0;
virtual void OnMenuButtonPressed(
CefRefPtr<CefMenuButton> menu_button,
const CefPoint& screen_point,
CefRefPtr<CefMenuButtonPressedLock> button_pressed_lock) = 0;
};
#endif // CEF_INCLUDE_VIEWS_CEF_MENU_BUTTON_DELEGATE_H_