summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.cc4
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.h5
-rw-r--r--content/browser/web_contents/touch_editable_impl_aura.cc20
-rw-r--r--content/browser/web_contents/touch_editable_impl_aura.h2
-rw-r--r--content/browser/web_contents/web_contents_view_aura.cc4
5 files changed, 19 insertions, 16 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index e06ed4f..f0fe263 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2546,7 +2546,7 @@ bool RenderWidgetHostViewAura::CanFocus() {
void RenderWidgetHostViewAura::OnCaptureLost() {
host_->LostCapture();
if (touch_editing_client_)
- touch_editing_client_->EndTouchEditing();
+ touch_editing_client_->EndTouchEditing(false);
}
void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) {
@@ -3061,7 +3061,7 @@ void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus,
host_->SetInputMethodActive(false);
if (touch_editing_client_)
- touch_editing_client_->EndTouchEditing();
+ touch_editing_client_->EndTouchEditing(false);
// If we lose the focus while fullscreen, close the window; Pepper Flash
// won't do it for us (unlike NPAPI Flash). However, we do not close the
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
index 37f5f4e..9e11115 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -120,8 +120,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
// Tells the client to start showing touch editing handles.
virtual void StartTouchEditing() = 0;
- // Notifies the client that touch editing is no longer needed.
- virtual void EndTouchEditing() = 0;
+ // Notifies the client that touch editing is no longer needed. |quick|
+ // determines whether the handles should fade out quickly or slowly.
+ virtual void EndTouchEditing(bool quick) = 0;
// Notifies the client that the selection bounds need to be updated.
virtual void OnSelectionOrCursorChanged(const gfx::Rect& anchor,
diff --git a/content/browser/web_contents/touch_editable_impl_aura.cc b/content/browser/web_contents/touch_editable_impl_aura.cc
index a9569df..00c69ce 100644
--- a/content/browser/web_contents/touch_editable_impl_aura.cc
+++ b/content/browser/web_contents/touch_editable_impl_aura.cc
@@ -62,7 +62,7 @@ void TouchEditableImplAura::UpdateEditingController() {
if (touch_selection_controller_)
touch_selection_controller_->SelectionChanged();
} else {
- EndTouchEditing();
+ EndTouchEditing(false);
}
}
@@ -105,12 +105,14 @@ void TouchEditableImplAura::StartTouchEditing() {
touch_selection_controller_->SelectionChanged();
}
-void TouchEditableImplAura::EndTouchEditing() {
+void TouchEditableImplAura::EndTouchEditing(bool quick) {
if (touch_selection_controller_) {
- if (touch_selection_controller_->IsHandleDragInProgress())
+ if (touch_selection_controller_->IsHandleDragInProgress()) {
touch_selection_controller_->SelectionChanged();
- else
+ } else {
+ touch_selection_controller_->HideHandles(quick);
touch_selection_controller_.reset();
+ }
}
}
@@ -131,7 +133,7 @@ bool TouchEditableImplAura::HandleInputEvent(const ui::Event* event) {
return false;
if (!event->IsGestureEvent()) {
- EndTouchEditing();
+ EndTouchEditing(false);
return false;
}
@@ -175,7 +177,7 @@ bool TouchEditableImplAura::HandleInputEvent(const ui::Event* event) {
handles_hidden_due_to_scroll_ = false;
if (touch_selection_controller_)
handles_hidden_due_to_scroll_ = true;
- EndTouchEditing();
+ EndTouchEditing(true);
break;
case ui::ET_GESTURE_SCROLL_END:
// Scroll has ended, but we might still be in overscroll animation.
@@ -287,7 +289,7 @@ void TouchEditableImplAura::OpenContextMenu(const gfx::Point& anchor) {
ConvertPointFromScreen(&point);
RenderWidgetHost* host = rwhva_->GetRenderWidgetHost();
host->Send(new ViewMsg_ShowContextMenu(host->GetRoutingID(), point));
- EndTouchEditing();
+ EndTouchEditing(false);
}
bool TouchEditableImplAura::IsCommandIdChecked(int command_id) const {
@@ -352,7 +354,7 @@ void TouchEditableImplAura::ExecuteCommand(int command_id, int event_flags) {
NOTREACHED();
break;
}
- EndTouchEditing();
+ EndTouchEditing(false);
}
////////////////////////////////////////////////////////////////////////////////
@@ -374,7 +376,7 @@ void TouchEditableImplAura::Cleanup() {
rwhva_ = NULL;
}
text_input_type_ = ui::TEXT_INPUT_TYPE_NONE;
- touch_selection_controller_.reset();
+ EndTouchEditing(true);
handles_hidden_due_to_scroll_ = false;
scroll_in_progress_ = false;
overscroll_in_progress_ = false;
diff --git a/content/browser/web_contents/touch_editable_impl_aura.h b/content/browser/web_contents/touch_editable_impl_aura.h
index 2758702..8190b7c 100644
--- a/content/browser/web_contents/touch_editable_impl_aura.h
+++ b/content/browser/web_contents/touch_editable_impl_aura.h
@@ -43,7 +43,7 @@ class CONTENT_EXPORT TouchEditableImplAura
// Overridden from RenderWidgetHostViewAura::TouchEditingClient.
virtual void StartTouchEditing() OVERRIDE;
- virtual void EndTouchEditing() OVERRIDE;
+ virtual void EndTouchEditing(bool quick) OVERRIDE;
virtual void OnSelectionOrCursorChanged(const gfx::Rect& anchor,
const gfx::Rect& focus) OVERRIDE;
virtual void OnTextInputTypeChanged(ui::TextInputType type) OVERRIDE;
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 09fdb7dc..1c12260 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -1405,7 +1405,7 @@ void WebContentsViewAura::SetOverscrollControllerEnabled(bool enabled) {
void WebContentsViewAura::ShowContextMenu(const ContextMenuParams& params) {
if (touch_editable_)
- touch_editable_->EndTouchEditing();
+ touch_editable_->EndTouchEditing(false);
if (delegate_) {
delegate_->ShowContextMenu(params);
// WARNING: we may have been deleted during the call to ShowContextMenu().
@@ -1436,7 +1436,7 @@ void WebContentsViewAura::StartDragging(
}
if (touch_editable_)
- touch_editable_->EndTouchEditing();
+ touch_editable_->EndTouchEditing(false);
ui::OSExchangeData::Provider* provider = ui::OSExchangeData::CreateProvider();
PrepareDragData(drop_data, provider, web_contents_);