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/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 new BrowserPluginMsg_CompositorFrameSwapped( | 341 new BrowserPluginMsg_CompositorFrameSwapped( |
342 browser_plugin_instance_id(), guest_params)); | 342 browser_plugin_instance_id(), guest_params)); |
343 } | 343 } |
344 | 344 |
345 void BrowserPluginGuest::SetContentsOpaque(bool opaque) { | 345 void BrowserPluginGuest::SetContentsOpaque(bool opaque) { |
346 SendMessageToEmbedder( | 346 SendMessageToEmbedder( |
347 new BrowserPluginMsg_SetContentsOpaque( | 347 new BrowserPluginMsg_SetContentsOpaque( |
348 browser_plugin_instance_id(), opaque)); | 348 browser_plugin_instance_id(), opaque)); |
349 } | 349 } |
350 | 350 |
| 351 void BrowserPluginGuest::OnFindReply(int request_id, |
| 352 int number_of_matches, |
| 353 const gfx::Rect& selection_rect, |
| 354 int active_match_ordinal, |
| 355 bool final_update) { |
| 356 // TODO(raymes): Check that this is a top-level guest first somehow. |
| 357 if (embedder_web_contents_) { |
| 358 embedder_web_contents_->OnFindReply(request_id, number_of_matches, |
| 359 selection_rect, active_match_ordinal, |
| 360 final_update); |
| 361 } |
| 362 } |
| 363 |
351 WebContentsImpl* BrowserPluginGuest::GetWebContents() const { | 364 WebContentsImpl* BrowserPluginGuest::GetWebContents() const { |
352 return static_cast<WebContentsImpl*>(web_contents()); | 365 return static_cast<WebContentsImpl*>(web_contents()); |
353 } | 366 } |
354 | 367 |
355 gfx::Point BrowserPluginGuest::GetScreenCoordinates( | 368 gfx::Point BrowserPluginGuest::GetScreenCoordinates( |
356 const gfx::Point& relative_position) const { | 369 const gfx::Point& relative_position) const { |
357 if (!attached()) | 370 if (!attached()) |
358 return relative_position; | 371 return relative_position; |
359 | 372 |
360 gfx::Point screen_pos(relative_position); | 373 gfx::Point screen_pos(relative_position); |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 817 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
805 const gfx::Range& range, | 818 const gfx::Range& range, |
806 const std::vector<gfx::Rect>& character_bounds) { | 819 const std::vector<gfx::Rect>& character_bounds) { |
807 static_cast<RenderWidgetHostViewBase*>( | 820 static_cast<RenderWidgetHostViewBase*>( |
808 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 821 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
809 range, character_bounds); | 822 range, character_bounds); |
810 } | 823 } |
811 #endif | 824 #endif |
812 | 825 |
813 } // namespace content | 826 } // namespace content |
OLD | NEW |