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..424d3e845fdd814c4dd17137988e05038427e0f8 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()) { |
} |
//////////////////////////////////////////////////////////////////////////////// |
@@ -900,6 +902,12 @@ void WebContentsViewAura::SetupOverlayWindowForTesting() { |
navigation_overlay_->SetupForTesting(); |
} |
+void WebContentsViewAura::SetTouchEditableForTest( |
+ TouchEditableImplAura* touch_editable) { |
+ touch_editable_.reset(touch_editable); |
+ AttachTouchEditableToRenderView(); |
+} |
+ |
void WebContentsViewAura::SizeChangedCommon(const gfx::Size& size) { |
if (web_contents_->GetInterstitialPage()) |
web_contents_->GetInterstitialPage()->SetSize(size); |
@@ -1114,6 +1122,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 +1290,7 @@ RenderWidgetHostView* WebContentsViewAura::CreateViewForWidget( |
navigation_overlay_.reset(new OverscrollNavigationOverlay()); |
} |
+ AttachTouchEditableToRenderView(); |
return view; |
} |
@@ -1294,6 +1311,7 @@ void WebContentsViewAura::RenderViewSwappedIn(RenderViewHost* host) { |
navigation_overlay_->StartObservingView(static_cast< |
RenderWidgetHostViewAura*>(host->GetView())); |
} |
+ AttachTouchEditableToRenderView(); |
} |
void WebContentsViewAura::SetOverscrollControllerEnabled(bool enabled) { |
@@ -1314,6 +1332,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 +1360,9 @@ void WebContentsViewAura::StartDragging( |
return; |
} |
+ if (touch_editable_) |
+ touch_editable_->EndTouchEditing(); |
+ |
ui::OSExchangeData::Provider* provider = ui::OSExchangeData::CreateProvider(); |
PrepareDragData(drop_data, provider); |