Index: content/browser/web_contents/web_contents_view_aura.cc |
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc |
index a87ebb0e7d0d5bddf5b587ba483d06c2606bfef4..b09c530f7ac1bd4398a15545cd9dfd3cf1e13057 100644 |
--- a/content/browser/web_contents/web_contents_view_aura.cc |
+++ b/content/browser/web_contents/web_contents_view_aura.cc |
@@ -15,6 +15,7 @@ |
#include "content/browser/renderer_host/render_widget_host_view_aura.h" |
#include "content/browser/web_contents/interstitial_page_impl.h" |
#include "content/browser/web_contents/navigation_entry_impl.h" |
+#include "content/browser/web_contents/touch_editable_impl_aura.h" |
#include "content/browser/web_contents/web_contents_impl.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
@@ -876,7 +877,8 @@ WebContentsViewAura::WebContentsViewAura( |
content_container_(NULL), |
overscroll_change_brightness_(false), |
current_overscroll_gesture_(OVERSCROLL_NONE), |
- completed_overscroll_gesture_(OVERSCROLL_NONE) { |
+ completed_overscroll_gesture_(OVERSCROLL_NONE), |
+ touch_editable_(TouchEditableImplAura::Create()) { |
} |
//////////////////////////////////////////////////////////////////////////////// |
@@ -1114,6 +1116,14 @@ void WebContentsViewAura::UpdateOverscrollWindowBrightness(float delta_x) { |
window->layer()->SetLayerBrightness(brightness); |
} |
+void WebContentsViewAura::AttachTouchEditableToRenderView() { |
+ if (!touch_editable_) |
+ return; |
+ RenderWidgetHostViewAura* rwhva = static_cast<RenderWidgetHostViewAura*>( |
+ web_contents_->GetRenderWidgetHostView()); |
+ touch_editable_->AttachToView(rwhva); |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// WebContentsViewAura, WebContentsView implementation: |
@@ -1274,6 +1284,7 @@ RenderWidgetHostView* WebContentsViewAura::CreateViewForWidget( |
navigation_overlay_.reset(new OverscrollNavigationOverlay()); |
} |
+ AttachTouchEditableToRenderView(); |
return view; |
} |
@@ -1294,6 +1305,7 @@ void WebContentsViewAura::RenderViewSwappedIn(RenderViewHost* host) { |
navigation_overlay_->StartObservingView(static_cast< |
RenderWidgetHostViewAura*>(host->GetView())); |
} |
+ AttachTouchEditableToRenderView(); |
} |
void WebContentsViewAura::SetOverscrollControllerEnabled(bool enabled) { |
@@ -1314,6 +1326,9 @@ void WebContentsViewAura::ShowContextMenu( |
ContextMenuSourceType type) { |
if (delegate_.get()) |
delegate_->ShowContextMenu(params, type); |
+ if (touch_editable_) |
+ touch_editable_->EndTouchEditing(); |
+ |
} |
void WebContentsViewAura::ShowPopupMenu(const gfx::Rect& bounds, |
@@ -1339,6 +1354,9 @@ void WebContentsViewAura::StartDragging( |
return; |
} |
+ if (touch_editable_) |
+ touch_editable_->EndTouchEditing(); |
+ |
ui::OSExchangeData::Provider* provider = ui::OSExchangeData::CreateProvider(); |
PrepareDragData(drop_data, provider); |