| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 InternalSwapCompositorFrame(last_frame_info_->output_surface_id, | 548 InternalSwapCompositorFrame(last_frame_info_->output_surface_id, |
| 549 std::move(last_frame_info_->frame)); | 549 std::move(last_frame_info_->frame)); |
| 550 last_frame_info_.reset(); | 550 last_frame_info_.reset(); |
| 551 } | 551 } |
| 552 | 552 |
| 553 if (!is_showing_ && view_.GetLayer()) | 553 if (!is_showing_ && view_.GetLayer()) |
| 554 view_.GetLayer()->SetHideLayerAndSubtree(true); | 554 view_.GetLayer()->SetHideLayerAndSubtree(true); |
| 555 } | 555 } |
| 556 } | 556 } |
| 557 | 557 |
| 558 void RenderWidgetHostViewAndroid::SetTextSurroundingSelectionCallback( | |
| 559 const TextSurroundingSelectionCallback& callback) { | |
| 560 // Only one outstanding request is allowed at any given time. | |
| 561 DCHECK(!callback.is_null()); | |
| 562 text_surrounding_selection_callback_ = callback; | |
| 563 } | |
| 564 | |
| 565 void RenderWidgetHostViewAndroid::OnTextSurroundingSelectionResponse( | |
| 566 const base::string16& content, | |
| 567 size_t start_offset, | |
| 568 size_t end_offset) { | |
| 569 if (text_surrounding_selection_callback_.is_null()) | |
| 570 return; | |
| 571 text_surrounding_selection_callback_.Run(content, start_offset, end_offset); | |
| 572 text_surrounding_selection_callback_.Reset(); | |
| 573 } | |
| 574 | |
| 575 void RenderWidgetHostViewAndroid::OnShowUnhandledTapUIIfNeeded(int x_dip, | 558 void RenderWidgetHostViewAndroid::OnShowUnhandledTapUIIfNeeded(int x_dip, |
| 576 int y_dip) { | 559 int y_dip) { |
| 577 if (!content_view_core_) | 560 if (!content_view_core_) |
| 578 return; | 561 return; |
| 579 // Validate the coordinates are within the viewport. | 562 // Validate the coordinates are within the viewport. |
| 580 gfx::Size viewport_size = content_view_core_->GetViewportSizeDip(); | 563 gfx::Size viewport_size = content_view_core_->GetViewportSizeDip(); |
| 581 if (x_dip < 0 || x_dip > viewport_size.width() || | 564 if (x_dip < 0 || x_dip > viewport_size.width() || |
| 582 y_dip < 0 || y_dip > viewport_size.height()) | 565 y_dip < 0 || y_dip > viewport_size.height()) |
| 583 return; | 566 return; |
| 584 content_view_core_->OnShowUnhandledTapUIIfNeeded(x_dip, y_dip); | 567 content_view_core_->OnShowUnhandledTapUIIfNeeded(x_dip, y_dip); |
| (...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1996 case ui::MotionEvent::ACTION_UP: | 1979 case ui::MotionEvent::ACTION_UP: |
| 1997 case ui::MotionEvent::ACTION_POINTER_UP: | 1980 case ui::MotionEvent::ACTION_POINTER_UP: |
| 1998 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 1981 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
| 1999 delta.InMicroseconds(), 1, 1000000, 50); | 1982 delta.InMicroseconds(), 1, 1000000, 50); |
| 2000 default: | 1983 default: |
| 2001 return; | 1984 return; |
| 2002 } | 1985 } |
| 2003 } | 1986 } |
| 2004 | 1987 |
| 2005 } // namespace content | 1988 } // namespace content |
| OLD | NEW |