OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 | 941 |
942 if (touch_editing_client_) { | 942 if (touch_editing_client_) { |
943 touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_, | 943 touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_, |
944 selection_focus_rect_); | 944 selection_focus_rect_); |
945 } | 945 } |
946 } | 946 } |
947 | 947 |
948 void RenderWidgetHostViewAura::CopyFromCompositingSurface( | 948 void RenderWidgetHostViewAura::CopyFromCompositingSurface( |
949 const gfx::Rect& src_subrect, | 949 const gfx::Rect& src_subrect, |
950 const gfx::Size& dst_size, | 950 const gfx::Size& dst_size, |
951 CopyFromCompositingSurfaceCallback& callback, | 951 ReadbackRequestCallback& callback, |
952 const SkColorType color_type) { | 952 const SkColorType color_type) { |
953 delegated_frame_host_->CopyFromCompositingSurface( | 953 delegated_frame_host_->CopyFromCompositingSurface( |
954 src_subrect, dst_size, callback, color_type); | 954 src_subrect, dst_size, callback, color_type); |
955 } | 955 } |
956 | 956 |
957 void RenderWidgetHostViewAura::CopyFromCompositingSurfaceToVideoFrame( | 957 void RenderWidgetHostViewAura::CopyFromCompositingSurfaceToVideoFrame( |
958 const gfx::Rect& src_subrect, | 958 const gfx::Rect& src_subrect, |
959 const scoped_refptr<media::VideoFrame>& target, | 959 const scoped_refptr<media::VideoFrame>& target, |
960 const base::Callback<void(bool)>& callback) { | 960 const base::Callback<void(bool)>& callback) { |
961 delegated_frame_host_->CopyFromCompositingSurfaceToVideoFrame( | 961 delegated_frame_host_->CopyFromCompositingSurfaceToVideoFrame( |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 CopyFromCompositingSurface( | 1245 CopyFromCompositingSurface( |
1246 disambiguation_target_rect_, | 1246 disambiguation_target_rect_, |
1247 zoomed_size, | 1247 zoomed_size, |
1248 base::Bind(&RenderWidgetHostViewAura::DisambiguationPopupRendered, | 1248 base::Bind(&RenderWidgetHostViewAura::DisambiguationPopupRendered, |
1249 base::internal::SupportsWeakPtrBase::StaticAsWeakPtr | 1249 base::internal::SupportsWeakPtrBase::StaticAsWeakPtr |
1250 <RenderWidgetHostViewAura>(this)), | 1250 <RenderWidgetHostViewAura>(this)), |
1251 kN32_SkColorType); | 1251 kN32_SkColorType); |
1252 } | 1252 } |
1253 | 1253 |
1254 void RenderWidgetHostViewAura::DisambiguationPopupRendered( | 1254 void RenderWidgetHostViewAura::DisambiguationPopupRendered( |
1255 bool success, | 1255 const SkBitmap& result, |
1256 const SkBitmap& result) { | 1256 const ReadbackResponse& response) { |
1257 if (!success || disambiguation_scroll_offset_ != last_scroll_offset_) | 1257 if ((response != READBACK_SUCCESS) || |
| 1258 disambiguation_scroll_offset_ != last_scroll_offset_) |
1258 return; | 1259 return; |
1259 | 1260 |
1260 // Use RenderViewHostDelegate to get to the WebContentsViewAura, which will | 1261 // Use RenderViewHostDelegate to get to the WebContentsViewAura, which will |
1261 // actually show the delegate. | 1262 // actually show the delegate. |
1262 RenderViewHostDelegate* delegate = NULL; | 1263 RenderViewHostDelegate* delegate = NULL; |
1263 if (host_->IsRenderView()) | 1264 if (host_->IsRenderView()) |
1264 delegate = RenderViewHost::From(host_)->GetDelegate(); | 1265 delegate = RenderViewHost::From(host_)->GetDelegate(); |
1265 RenderViewHostDelegateView* delegate_view = NULL; | 1266 RenderViewHostDelegateView* delegate_view = NULL; |
1266 if (delegate) | 1267 if (delegate) |
1267 delegate_view = delegate->GetDelegateView(); | 1268 delegate_view = delegate->GetDelegateView(); |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2540 | 2541 |
2541 //////////////////////////////////////////////////////////////////////////////// | 2542 //////////////////////////////////////////////////////////////////////////////// |
2542 // RenderWidgetHostViewBase, public: | 2543 // RenderWidgetHostViewBase, public: |
2543 | 2544 |
2544 // static | 2545 // static |
2545 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2546 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
2546 GetScreenInfoForWindow(results, NULL); | 2547 GetScreenInfoForWindow(results, NULL); |
2547 } | 2548 } |
2548 | 2549 |
2549 } // namespace content | 2550 } // namespace content |
OLD | NEW |