Chromium Code Reviews| Index: pdf/instance.cc |
| diff --git a/pdf/instance.cc b/pdf/instance.cc |
| index 90370af88f9baef5535247471b6b78e07f93cbb1..11be67c2f83107b7bed27084e4352b5264ed2d42 100644 |
| --- a/pdf/instance.cc |
| +++ b/pdf/instance.cc |
| @@ -434,7 +434,8 @@ bool Instance::HandleInputEvent(const pp::InputEvent& event) { |
| return true; |
| #endif |
| - if (toolbar_->HandleEvent(event_device_res)) |
| + if (!IsMouseOnScrollbar(event_device_res) && |
| + toolbar_->HandleEvent(event_device_res)) |
| return true; |
| #ifdef ENABLE_THUMBNAILS |
| @@ -496,14 +497,8 @@ bool Instance::HandleInputEvent(const pp::InputEvent& event) { |
| if (!IsOverlayScrollbar() && |
| !available_area_.Contains(mouse_event.GetPosition())) { |
| try_engine_first = false; |
| - } else if (IsOverlayScrollbar()) { |
| - pp::Rect temp; |
| - if ((v_scrollbar_.get() && v_scrollbar_->GetLocation(&temp) && |
| - temp.Contains(mouse_event_dip.GetPosition())) || |
| - (h_scrollbar_.get() && h_scrollbar_->GetLocation(&temp) && |
| - temp.Contains(mouse_event_dip.GetPosition()))) { |
| + } else if (IsOverlayScrollbar() && IsMouseOnScrollbar(event)) { |
| try_engine_first = false; |
| - } |
| } |
| } |
| break; |
| @@ -1604,6 +1599,19 @@ void Instance::RotateCounterclockwise() { |
| engine_->RotateCounterclockwise(); |
| } |
| +bool Instance::IsMouseOnScrollbar(const pp::InputEvent& event) { |
|
gene
2015/01/05 21:51:32
It probably make sense to accept mouse events only
Deepak
2015/01/06 09:20:32
Thanks for review.
I agree with you,as we are not
|
| + pp::MouseInputEvent mouse_event(event); |
| + pp::Point pt = mouse_event.GetPosition(); |
| + pp::Rect temp; |
| + if ((v_scrollbar_.get() && v_scrollbar_->GetLocation(&temp) && |
| + temp.Contains(pt)) || |
| + (h_scrollbar_.get() && h_scrollbar_->GetLocation(&temp) && |
| + temp.Contains(pt))) { |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| void Instance::PreviewDocumentLoadComplete() { |
| if (preview_document_load_state_ != LOAD_STATE_LOADING || |
| preview_pages_info_.empty()) { |