mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@ -56,12 +56,16 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::StateChanged(
|
||||
CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed(
|
||||
views::Button* sender,
|
||||
const ui::Event& event) {
|
||||
// Callback may trigger new animation state.
|
||||
if (ParentClass::cef_delegate())
|
||||
ParentClass::cef_delegate()->OnButtonPressed(GetCefButton());
|
||||
if (ParentClass::ink_drop_mode() != views::CustomButton::InkDropMode::OFF &&
|
||||
!ParentClass::IsFocusable()) {
|
||||
// When ink drop is enabled for non-focusable buttons the ink drop state
|
||||
// does not get reset properly on click, so we do it here explicitly.
|
||||
!ParentClass::IsFocusable() &&
|
||||
ParentClass::state() != views::CustomButton::STATE_PRESSED) {
|
||||
// Ink drop state does not get reset properly on click when the button is
|
||||
// non-focusable. Reset the ink drop state here if the state has not been
|
||||
// explicitly set to pressed by the OnButtonPressed callback calling
|
||||
// SetState (which also sets the ink drop state).
|
||||
ParentClass::AnimateInkDrop(views::InkDropState::HIDDEN,
|
||||
ui::LocatedEvent::FromIfValid(&event));
|
||||
}
|
||||
|
Reference in New Issue
Block a user