Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 186753002: Chromium plumbing to use the selection root bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind_helpers.h" 5 #include "base/bind_helpers.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "content/browser/browser_plugin/browser_plugin_guest.h" 9 #include "content/browser/browser_plugin/browser_plugin_guest.h"
10 #include "content/browser/frame_host/render_widget_host_view_guest.h" 10 #include "content/browser/frame_host/render_widget_host_view_guest.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV( 360 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV(
361 guest_->GetEmbedderRenderWidgetHostView()); 361 guest_->GetEmbedderRenderWidgetHostView());
362 if (!rwhv) 362 if (!rwhv)
363 return; 363 return;
364 ViewHostMsg_SelectionBounds_Params guest_params(params); 364 ViewHostMsg_SelectionBounds_Params guest_params(params);
365 guest_params.anchor_rect = guest_->ToGuestRect(params.anchor_rect); 365 guest_params.anchor_rect = guest_->ToGuestRect(params.anchor_rect);
366 guest_params.focus_rect = guest_->ToGuestRect(params.focus_rect); 366 guest_params.focus_rect = guest_->ToGuestRect(params.focus_rect);
367 rwhv->SelectionBoundsChanged(guest_params); 367 rwhv->SelectionBoundsChanged(guest_params);
368 } 368 }
369 369
370 #if defined(OS_ANDROID)
371 void RenderWidgetHostViewGuest::SelectionRootBoundsChanged(
372 const gfx::Rect& bounds) {
373 if (!guest_)
374 return;
375
376 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV(
377 guest_->GetEmbedderRenderWidgetHostView());
378 if (!rwhv)
379 return;
380
381 rwhv->SelectionRootBoundsChanged(guest_->ToGuestRect(bounds));
382 }
383 #endif
384
370 void RenderWidgetHostViewGuest::CopyFromCompositingSurface( 385 void RenderWidgetHostViewGuest::CopyFromCompositingSurface(
371 const gfx::Rect& src_subrect, 386 const gfx::Rect& src_subrect,
372 const gfx::Size& dst_size, 387 const gfx::Size& dst_size,
373 const base::Callback<void(bool, const SkBitmap&)>& callback, 388 const base::Callback<void(bool, const SkBitmap&)>& callback,
374 const SkBitmap::Config config) { 389 const SkBitmap::Config config) {
375 CHECK(guest_); 390 CHECK(guest_);
376 guest_->CopyFromCompositingSurface(src_subrect, dst_size, callback); 391 guest_->CopyFromCompositingSurface(src_subrect, dst_size, callback);
377 } 392 }
378 393
379 void RenderWidgetHostViewGuest::SetBackground(const SkBitmap& background) { 394 void RenderWidgetHostViewGuest::SetBackground(const SkBitmap& background) {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 ++g_it) { 587 ++g_it) {
573 ForwardGestureEventToRenderer(*g_it); 588 ForwardGestureEventToRenderer(*g_it);
574 } 589 }
575 } 590 }
576 591
577 SkBitmap::Config RenderWidgetHostViewGuest::PreferredReadbackFormat() { 592 SkBitmap::Config RenderWidgetHostViewGuest::PreferredReadbackFormat() {
578 return SkBitmap::kARGB_8888_Config; 593 return SkBitmap::kARGB_8888_Config;
579 } 594 }
580 595
581 } // namespace content 596 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_widget_host_view_guest.h ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698