| 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/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 10 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 void BrowserPluginGuest::SetFocus(bool focused) { | 369 void BrowserPluginGuest::SetFocus(bool focused) { |
| 370 RenderViewHost* render_view_host = web_contents()->GetRenderViewHost(); | 370 RenderViewHost* render_view_host = web_contents()->GetRenderViewHost(); |
| 371 render_view_host->Send( | 371 render_view_host->Send( |
| 372 new ViewMsg_SetFocus(render_view_host->GetRoutingID(), focused)); | 372 new ViewMsg_SetFocus(render_view_host->GetRoutingID(), focused)); |
| 373 } | 373 } |
| 374 | 374 |
| 375 void BrowserPluginGuest::ShowWidget(RenderViewHost* render_view_host, | 375 void BrowserPluginGuest::ShowWidget(RenderViewHost* render_view_host, |
| 376 int route_id, | 376 int route_id, |
| 377 const gfx::Rect& initial_pos) { | 377 const gfx::Rect& initial_pos) { |
| 378 gfx::Rect screen_pos(initial_pos); | 378 gfx::Rect screen_pos(initial_pos); |
| 379 screen_pos.Offset(guest_rect_.origin()); | 379 screen_pos.Offset(guest_rect_.OffsetFromOrigin()); |
| 380 static_cast<WebContentsImpl*>(web_contents())->ShowCreatedWidget(route_id, | 380 static_cast<WebContentsImpl*>(web_contents())->ShowCreatedWidget(route_id, |
| 381 screen_pos); | 381 screen_pos); |
| 382 } | 382 } |
| 383 | 383 |
| 384 void BrowserPluginGuest::SetCursor(const WebCursor& cursor) { | 384 void BrowserPluginGuest::SetCursor(const WebCursor& cursor) { |
| 385 cursor_ = cursor; | 385 cursor_ = cursor; |
| 386 } | 386 } |
| 387 | 387 |
| 388 void BrowserPluginGuest::DidStartProvisionalLoadForFrame( | 388 void BrowserPluginGuest::DidStartProvisionalLoadForFrame( |
| 389 int64 frame_id, | 389 int64 frame_id, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 default: | 489 default: |
| 490 break; | 490 break; |
| 491 } | 491 } |
| 492 } | 492 } |
| 493 | 493 |
| 494 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 494 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
| 495 embedder_web_contents_->GetRenderProcessHost()->Send(msg); | 495 embedder_web_contents_->GetRenderProcessHost()->Send(msg); |
| 496 } | 496 } |
| 497 | 497 |
| 498 } // namespace content | 498 } // namespace content |
| OLD | NEW |