| 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 InternalSwapCompositorFrame(last_frame_info_->output_surface_id, | 549 InternalSwapCompositorFrame(last_frame_info_->output_surface_id, |
| 550 std::move(last_frame_info_->frame)); | 550 std::move(last_frame_info_->frame)); |
| 551 last_frame_info_.reset(); | 551 last_frame_info_.reset(); |
| 552 } | 552 } |
| 553 | 553 |
| 554 if (!is_showing_ && view_.GetLayer()) | 554 if (!is_showing_ && view_.GetLayer()) |
| 555 view_.GetLayer()->SetHideLayerAndSubtree(true); | 555 view_.GetLayer()->SetHideLayerAndSubtree(true); |
| 556 } | 556 } |
| 557 } | 557 } |
| 558 | 558 |
| 559 void RenderWidgetHostViewAndroid::SetTextSurroundingSelectionCallback( | |
| 560 const TextSurroundingSelectionCallback& callback) { | |
| 561 // Only one outstanding request is allowed at any given time. | |
| 562 DCHECK(!callback.is_null()); | |
| 563 text_surrounding_selection_callback_ = callback; | |
| 564 } | |
| 565 | |
| 566 void RenderWidgetHostViewAndroid::OnTextSurroundingSelectionResponse( | |
| 567 const base::string16& content, | |
| 568 size_t start_offset, | |
| 569 size_t end_offset) { | |
| 570 if (text_surrounding_selection_callback_.is_null()) | |
| 571 return; | |
| 572 text_surrounding_selection_callback_.Run(content, start_offset, end_offset); | |
| 573 text_surrounding_selection_callback_.Reset(); | |
| 574 } | |
| 575 | |
| 576 void RenderWidgetHostViewAndroid::OnShowUnhandledTapUIIfNeeded(int x_dip, | 559 void RenderWidgetHostViewAndroid::OnShowUnhandledTapUIIfNeeded(int x_dip, |
| 577 int y_dip) { | 560 int y_dip) { |
| 578 if (!content_view_core_) | 561 if (!content_view_core_) |
| 579 return; | 562 return; |
| 580 // Validate the coordinates are within the viewport. | 563 // Validate the coordinates are within the viewport. |
| 581 gfx::Size viewport_size = content_view_core_->GetViewportSizeDip(); | 564 gfx::Size viewport_size = content_view_core_->GetViewportSizeDip(); |
| 582 if (x_dip < 0 || x_dip > viewport_size.width() || | 565 if (x_dip < 0 || x_dip > viewport_size.width() || |
| 583 y_dip < 0 || y_dip > viewport_size.height()) | 566 y_dip < 0 || y_dip > viewport_size.height()) |
| 584 return; | 567 return; |
| 585 content_view_core_->OnShowUnhandledTapUIIfNeeded(x_dip, y_dip); | 568 content_view_core_->OnShowUnhandledTapUIIfNeeded(x_dip, y_dip); |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2000 case ui::MotionEvent::ACTION_UP: | 1983 case ui::MotionEvent::ACTION_UP: |
| 2001 case ui::MotionEvent::ACTION_POINTER_UP: | 1984 case ui::MotionEvent::ACTION_POINTER_UP: |
| 2002 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 1985 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
| 2003 delta.InMicroseconds(), 1, 1000000, 50); | 1986 delta.InMicroseconds(), 1, 1000000, 50); |
| 2004 default: | 1987 default: |
| 2005 return; | 1988 return; |
| 2006 } | 1989 } |
| 2007 } | 1990 } |
| 2008 | 1991 |
| 2009 } // namespace content | 1992 } // namespace content |
| OLD | NEW |