OLD | NEW |
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // The RenderWidgetHost's destruction led here, so don't call it. | 154 // The RenderWidgetHost's destruction led here, so don't call it. |
155 DestroyGuestView(); | 155 DestroyGuestView(); |
156 | 156 |
157 platform_view_->Destroy(); | 157 platform_view_->Destroy(); |
158 } | 158 } |
159 | 159 |
160 gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { | 160 gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { |
161 return RenderWidgetHostViewBase::GetPhysicalBackingSize(); | 161 return RenderWidgetHostViewBase::GetPhysicalBackingSize(); |
162 } | 162 } |
163 | 163 |
| 164 base::string16 RenderWidgetHostViewGuest::GetSelectedText() const { |
| 165 return platform_view_->GetSelectedText(); |
| 166 } |
| 167 |
164 void RenderWidgetHostViewGuest::SetTooltipText( | 168 void RenderWidgetHostViewGuest::SetTooltipText( |
165 const base::string16& tooltip_text) { | 169 const base::string16& tooltip_text) { |
166 platform_view_->SetTooltipText(tooltip_text); | 170 platform_view_->SetTooltipText(tooltip_text); |
167 } | 171 } |
168 | 172 |
169 void RenderWidgetHostViewGuest::AcceleratedSurfaceBuffersSwapped( | 173 void RenderWidgetHostViewGuest::AcceleratedSurfaceBuffersSwapped( |
170 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, | 174 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
171 int gpu_host_id) { | 175 int gpu_host_id) { |
172 // If accelerated surface buffers are getting swapped then we're not using | 176 // If accelerated surface buffers are getting swapped then we're not using |
173 // the software path. | 177 // the software path. |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 const gfx::Rect& scroll_rect, | 329 const gfx::Rect& scroll_rect, |
326 const gfx::Vector2d& scroll_delta, | 330 const gfx::Vector2d& scroll_delta, |
327 const std::vector<gfx::Rect>& copy_rects, | 331 const std::vector<gfx::Rect>& copy_rects, |
328 const std::vector<ui::LatencyInfo>& latency_info) { | 332 const std::vector<ui::LatencyInfo>& latency_info) { |
329 NOTREACHED(); | 333 NOTREACHED(); |
330 } | 334 } |
331 | 335 |
332 void RenderWidgetHostViewGuest::SelectionChanged(const base::string16& text, | 336 void RenderWidgetHostViewGuest::SelectionChanged(const base::string16& text, |
333 size_t offset, | 337 size_t offset, |
334 const gfx::Range& range) { | 338 const gfx::Range& range) { |
335 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV( | 339 platform_view_->SelectionChanged(text, offset, range); |
336 guest_->GetEmbedderRenderWidgetHostView()); | |
337 if (!rwhv) | |
338 return; | |
339 // Forward the information to embedding RWHV. | |
340 rwhv->SelectionChanged(text, offset, range); | |
341 } | 340 } |
342 | 341 |
343 void RenderWidgetHostViewGuest::SelectionBoundsChanged( | 342 void RenderWidgetHostViewGuest::SelectionBoundsChanged( |
344 const ViewHostMsg_SelectionBounds_Params& params) { | 343 const ViewHostMsg_SelectionBounds_Params& params) { |
345 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV( | 344 RenderWidgetHostViewPort* rwhv = RenderWidgetHostViewPort::FromRWHV( |
346 guest_->GetEmbedderRenderWidgetHostView()); | 345 guest_->GetEmbedderRenderWidgetHostView()); |
347 if (!rwhv) | 346 if (!rwhv) |
348 return; | 347 return; |
349 ViewHostMsg_SelectionBounds_Params guest_params(params); | 348 ViewHostMsg_SelectionBounds_Params guest_params(params); |
350 guest_params.anchor_rect = guest_->ToGuestRect(params.anchor_rect); | 349 guest_params.anchor_rect = guest_->ToGuestRect(params.anchor_rect); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 return; | 551 return; |
553 for (ui::GestureRecognizer::Gestures::iterator g_it = gestures->begin(); | 552 for (ui::GestureRecognizer::Gestures::iterator g_it = gestures->begin(); |
554 g_it != gestures->end(); | 553 g_it != gestures->end(); |
555 ++g_it) { | 554 ++g_it) { |
556 ForwardGestureEventToRenderer(*g_it); | 555 ForwardGestureEventToRenderer(*g_it); |
557 } | 556 } |
558 } | 557 } |
559 | 558 |
560 | 559 |
561 } // namespace content | 560 } // namespace content |
OLD | NEW |