| 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_guest_helper.h" | 10 #include "content/browser/browser_plugin/browser_plugin_guest_helper.h" |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 void BrowserPluginGuest::SetFocus(bool focused) { | 362 void BrowserPluginGuest::SetFocus(bool focused) { |
| 363 RenderViewHost* render_view_host = web_contents()->GetRenderViewHost(); | 363 RenderViewHost* render_view_host = web_contents()->GetRenderViewHost(); |
| 364 render_view_host->Send( | 364 render_view_host->Send( |
| 365 new ViewMsg_SetFocus(render_view_host->GetRoutingID(), focused)); | 365 new ViewMsg_SetFocus(render_view_host->GetRoutingID(), focused)); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void BrowserPluginGuest::ShowWidget(RenderViewHost* render_view_host, | 368 void BrowserPluginGuest::ShowWidget(RenderViewHost* render_view_host, |
| 369 int route_id, | 369 int route_id, |
| 370 const gfx::Rect& initial_pos) { | 370 const gfx::Rect& initial_pos) { |
| 371 gfx::Rect screen_pos(initial_pos); | 371 gfx::Rect screen_pos(initial_pos); |
| 372 screen_pos.Offset(guest_rect_.origin()); | 372 screen_pos.Offset(guest_rect_.DistanceFromOrigin()); |
| 373 static_cast<WebContentsImpl*>(web_contents())->ShowCreatedWidget(route_id, | 373 static_cast<WebContentsImpl*>(web_contents())->ShowCreatedWidget(route_id, |
| 374 screen_pos); | 374 screen_pos); |
| 375 } | 375 } |
| 376 | 376 |
| 377 void BrowserPluginGuest::SetCursor(const WebCursor& cursor) { | 377 void BrowserPluginGuest::SetCursor(const WebCursor& cursor) { |
| 378 cursor_ = cursor; | 378 cursor_ = cursor; |
| 379 } | 379 } |
| 380 | 380 |
| 381 void BrowserPluginGuest::DidStartProvisionalLoadForFrame( | 381 void BrowserPluginGuest::DidStartProvisionalLoadForFrame( |
| 382 int64 frame_id, | 382 int64 frame_id, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 default: | 474 default: |
| 475 break; | 475 break; |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 | 478 |
| 479 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 479 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
| 480 embedder_web_contents_->GetRenderProcessHost()->Send(msg); | 480 embedder_web_contents_->GetRenderProcessHost()->Send(msg); |
| 481 } | 481 } |
| 482 | 482 |
| 483 } // namespace content | 483 } // namespace content |
| OLD | NEW |