diff options
Diffstat (limited to 'components/html_viewer/html_frame.cc')
-rw-r--r-- | components/html_viewer/html_frame.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/components/html_viewer/html_frame.cc b/components/html_viewer/html_frame.cc index 1ddb997..50a183d 100644 --- a/components/html_viewer/html_frame.cc +++ b/components/html_viewer/html_frame.cc @@ -584,11 +584,15 @@ web_view::mojom::Frame* HTMLFrame::GetServerFrame() { } void HTMLFrame::SetWindow(mus::Window* window) { - if (window_) + if (window_) { + window_->set_input_event_handler(nullptr); window_->RemoveObserver(this); + } window_ = window; - if (window_) + if (window_) { window_->AddObserver(this); + window_->set_input_event_handler(this); + } } void HTMLFrame::CreateRootWebWidget() { @@ -757,8 +761,14 @@ void HTMLFrame::OnWindowDestroyed(mus::Window* window) { Close(); } +void HTMLFrame::OnWindowFocusChanged(mus::Window* gained_focus, + mus::Window* lost_focus) { + UpdateFocus(); +} + void HTMLFrame::OnWindowInputEvent(mus::Window* window, - const mus::mojom::EventPtr& event) { + mus::mojom::EventPtr event, + scoped_ptr<base::Closure>* ack_callback) { if (event->pointer_data && event->pointer_data->location) { // Blink expects coordintes to be in DIPs. event->pointer_data->location->x /= global_state()->device_pixel_ratio(); @@ -794,11 +804,6 @@ void HTMLFrame::OnWindowInputEvent(mus::Window* window, web_widget->handleInputEvent(*web_event); } -void HTMLFrame::OnWindowFocusChanged(mus::Window* gained_focus, - mus::Window* lost_focus) { - UpdateFocus(); -} - void HTMLFrame::OnConnect( web_view::mojom::FramePtr frame, uint32_t change_id, |