| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/input/touch_selection_controller_client_
aura.h" | 5 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 8 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| 9 #include "content/browser/renderer_host/render_widget_host_impl.h" | 9 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 void TouchSelectionControllerClientAura::OnScrollCompleted() { | 151 void TouchSelectionControllerClientAura::OnScrollCompleted() { |
| 152 scroll_in_progress_ = false; | 152 scroll_in_progress_ = false; |
| 153 rwhva_->selection_controller()->SetTemporarilyHidden(false); | 153 rwhva_->selection_controller()->SetTemporarilyHidden(false); |
| 154 UpdateQuickMenu(); | 154 UpdateQuickMenu(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool TouchSelectionControllerClientAura::HandleContextMenu( | 157 bool TouchSelectionControllerClientAura::HandleContextMenu( |
| 158 const ContextMenuParams& params) { | 158 const ContextMenuParams& params) { |
| 159 if (params.source_type == ui::MENU_SOURCE_LONG_PRESS && | 159 if (params.source_type == ui::MENU_SOURCE_LONG_PRESS && |
| 160 rwhva_->selection_controller()->insertion_active_or_requested() && | 160 (rwhva_->selection_controller()->active_status() == |
| 161 ui::TouchSelectionController::INSERTION_ACTIVE) && |
| 161 IsQuickMenuAvailable()) { | 162 IsQuickMenuAvailable()) { |
| 162 DCHECK(params.is_editable); | 163 DCHECK(params.is_editable); |
| 163 DCHECK(params.selection_text.empty()); | 164 DCHECK(params.selection_text.empty()); |
| 164 quick_menu_requested_ = true; | 165 quick_menu_requested_ = true; |
| 165 UpdateQuickMenu(); | 166 UpdateQuickMenu(); |
| 166 return true; | 167 return true; |
| 167 } | 168 } |
| 168 rwhva_->selection_controller()->HideAndDisallowShowingAutomatically(); | 169 rwhva_->selection_controller()->HideAndDisallowShowingAutomatically(); |
| 169 return false; | 170 return false; |
| 170 } | 171 } |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 ui::MENU_SOURCE_TOUCH_EDIT_MENU, | 371 ui::MENU_SOURCE_TOUCH_EDIT_MENU, |
| 371 gfx::ToRoundedPoint(anchor_point))); | 372 gfx::ToRoundedPoint(anchor_point))); |
| 372 | 373 |
| 373 // Hide selection handles after getting rect-between-bounds from touch | 374 // Hide selection handles after getting rect-between-bounds from touch |
| 374 // selection controller; otherwise, rect would be empty and the above | 375 // selection controller; otherwise, rect would be empty and the above |
| 375 // calculations would be invalid. | 376 // calculations would be invalid. |
| 376 rwhva_->selection_controller()->HideAndDisallowShowingAutomatically(); | 377 rwhva_->selection_controller()->HideAndDisallowShowingAutomatically(); |
| 377 } | 378 } |
| 378 | 379 |
| 379 } // namespace content | 380 } // namespace content |
| OLD | NEW |