Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Unified Diff: content/browser/renderer_host/input/touch_selection_controller.cc

Issue 359033002: [Android] Enable composited selection updates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_native_handles_0_compositor
Patch Set: Rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/touch_selection_controller.cc
diff --git a/content/browser/renderer_host/input/touch_selection_controller.cc b/content/browser/renderer_host/input/touch_selection_controller.cc
index e904e283ee0716401cea8556353b8eba048032d1..fc1b00477f6f2d9ce0f8832b0e70b4d5a9ac94ab 100644
--- a/content/browser/renderer_host/input/touch_selection_controller.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller.cc
@@ -43,8 +43,7 @@ TouchSelectionController::TouchSelectionController(
is_selection_active_(false),
activate_selection_automatically_(false),
selection_empty_(false),
- selection_editable_(false),
- temporarily_hidden_(false) {
+ selection_editable_(false) {
DCHECK(client_);
HideAndDisallowShowingAutomatically();
}
@@ -160,20 +159,6 @@ void TouchSelectionController::HideAndDisallowShowingAutomatically() {
activate_selection_automatically_ = false;
}
-void TouchSelectionController::SetTemporarilyHidden(bool hidden) {
- if (temporarily_hidden_ == hidden)
- return;
- temporarily_hidden_ = hidden;
-
- TouchHandle::AnimationStyle animation_style = GetAnimationStyle(true);
- if (is_selection_active_) {
- start_selection_handle_->SetVisible(GetStartVisible(), animation_style);
- end_selection_handle_->SetVisible(GetEndVisible(), animation_style);
- }
- if (is_insertion_active_)
- insertion_handle_->SetVisible(GetStartVisible(), animation_style);
-}
-
void TouchSelectionController::OnSelectionEditable(bool editable) {
if (selection_editable_ == editable)
return;
@@ -292,8 +277,7 @@ void TouchSelectionController::OnInsertionChanged() {
else
client_->OnSelectionEvent(INSERTION_MOVED, position);
- insertion_handle_->SetVisible(GetStartVisible(),
- GetAnimationStyle(was_active));
+ insertion_handle_->SetVisible(start_.visible, GetAnimationStyle(was_active));
insertion_handle_->SetPosition(position);
}
@@ -307,8 +291,8 @@ void TouchSelectionController::OnSelectionChanged() {
ActivateSelection();
const TouchHandle::AnimationStyle animation = GetAnimationStyle(was_active);
- start_selection_handle_->SetVisible(GetStartVisible(), animation);
- end_selection_handle_->SetVisible(GetEndVisible(), animation);
+ start_selection_handle_->SetVisible(start_.visible, animation);
+ end_selection_handle_->SetVisible(end_.visible, animation);
start_selection_handle_->SetPosition(GetStartPosition());
end_selection_handle_->SetPosition(GetEndPosition());
@@ -399,14 +383,6 @@ gfx::Vector2dF TouchSelectionController::GetEndLineOffset() const {
return gfx::ScaleVector2d(end_.edge_top - end_.edge_bottom, 0.5f);
}
-bool TouchSelectionController::GetStartVisible() const {
- return start_.visible && !temporarily_hidden_;
-}
-
-bool TouchSelectionController::GetEndVisible() const {
- return end_.visible && !temporarily_hidden_;
-}
-
TouchHandle::AnimationStyle TouchSelectionController::GetAnimationStyle(
bool was_active) const {
return was_active && client_->SupportsAnimation()

Powered by Google App Engine
This is Rietveld 408576698