Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / browser / frame_host / render_widget_host_view_child_frame.cc
index 94e7e13..99e58e8 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
 
+#include "content/browser/accessibility/browser_accessibility_manager.h"
 #include "content/browser/frame_host/cross_process_frame_connector.h"
 #include "content/browser/renderer_host/render_widget_host_impl.h"
 #include "content/common/gpu/gpu_messages.h"
@@ -70,6 +71,10 @@ gfx::Rect RenderWidgetHostViewChildFrame::GetViewBounds() const {
   return rect;
 }
 
+gfx::Vector2dF RenderWidgetHostViewChildFrame::GetLastScrollOffset() const {
+  return last_scroll_offset_;
+}
+
 gfx::NativeView RenderWidgetHostViewChildFrame::GetNativeView() const {
   NOTREACHED();
   return NULL;
@@ -182,12 +187,14 @@ void RenderWidgetHostViewChildFrame::SelectionBoundsChanged(
     const ViewHostMsg_SelectionBounds_Params& params) {
 }
 
-#if defined(OS_ANDROID)
+#if defined(OS_ANDROID) || defined(TOOLKIT_VIEWS) || defined(USE_AURA)
 void RenderWidgetHostViewChildFrame::ShowDisambiguationPopup(
-    const gfx::Rect& target_rect,
+    const gfx::Rect& rect_pixels,
     const SkBitmap& zoomed_bitmap) {
 }
+#endif
 
+#if defined(OS_ANDROID)
 void RenderWidgetHostViewChildFrame::LockCompositingSurface() {
 }
 
@@ -195,9 +202,6 @@ void RenderWidgetHostViewChildFrame::UnlockCompositingSurface() {
 }
 #endif
 
-void RenderWidgetHostViewChildFrame::ScrollOffsetChanged() {
-}
-
 void RenderWidgetHostViewChildFrame::AcceleratedSurfaceInitialized(int host_id,
                                                               int route_id) {
 }
@@ -205,8 +209,7 @@ void RenderWidgetHostViewChildFrame::AcceleratedSurfaceInitialized(int host_id,
 void RenderWidgetHostViewChildFrame::AcceleratedSurfaceBuffersSwapped(
     const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
     int gpu_host_id) {
-  if (frame_connector_)
-    frame_connector_->ChildFrameBuffersSwapped(params, gpu_host_id);
+  NOTREACHED();
 }
 
 void RenderWidgetHostViewChildFrame::AcceleratedSurfacePostSubBuffer(
@@ -217,6 +220,7 @@ void RenderWidgetHostViewChildFrame::AcceleratedSurfacePostSubBuffer(
 void RenderWidgetHostViewChildFrame::OnSwapCompositorFrame(
       uint32 output_surface_id,
       scoped_ptr<cc::CompositorFrame> frame) {
+  last_scroll_offset_ = frame->metadata.root_scroll_offset;
   if (frame_connector_) {
     frame_connector_->ChildFrameCompositorFrameSwapped(
         output_surface_id,
@@ -288,7 +292,7 @@ bool RenderWidgetHostViewChildFrame::PostProcessEventForPluginIme(
 void RenderWidgetHostViewChildFrame::CopyFromCompositingSurface(
     const gfx::Rect& src_subrect,
     const gfx::Size& /* dst_size */,
-    const base::Callback<void(bool, const SkBitmap&)>& callback,
+    CopyFromCompositingSurfaceCallback& callback,
     const SkColorType color_type) {
   callback.Run(false, SkBitmap());
 }
@@ -339,9 +343,8 @@ SkColorType RenderWidgetHostViewChildFrame::PreferredReadbackFormat() {
 BrowserAccessibilityManager*
 RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager(
     BrowserAccessibilityDelegate* delegate) {
-  // This eventually needs to be implemented for cross-process iframes.
-  // http://crbug.com/368298
-  return NULL;
+  return BrowserAccessibilityManager::Create(
+      BrowserAccessibilityManager::GetEmptyDocument(), delegate);
 }
 
 }  // namespace content