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

@ -49,8 +49,25 @@ CEF_BUTTON_IMPL_T class CefButtonImpl : public CEF_VIEW_IMPL_D {
CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) {
CEF_REQUIRE_VALID_RETURN_VOID();
ParentClass::root_view()->SetState(
static_cast<views::Button::ButtonState>(state));
views::Button::ButtonState old_state = ParentClass::root_view()->state();
views::Button::ButtonState new_state =
static_cast<views::Button::ButtonState>(state);
if (ParentClass::root_view()->ink_drop_mode() !=
views::CustomButton::InkDropMode::OFF &&
!ParentClass::root_view()->IsFocusable()) {
// Ink drop state does not get set properly on state change when the button
// is non-focusable.
views::InkDropState ink_state = views::InkDropState::HIDDEN;
if (new_state == views::Button::STATE_PRESSED) {
ink_state = views::InkDropState::ACTIVATED;
} else if (old_state == views::Button::STATE_PRESSED) {
ink_state = views::InkDropState::DEACTIVATED;
}
ParentClass::root_view()->AnimateInkDrop(ink_state, nullptr);
}
ParentClass::root_view()->SetState(new_state);
}
CEF_BUTTON_IMPL_T cef_button_state_t CEF_BUTTON_IMPL_D::GetState() {