summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_plugin
diff options
context:
space:
mode:
authorfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-27 20:35:29 +0000
committerfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-27 20:35:29 +0000
commit93f59c4e342fc2dabc56e207f5e25b993daf3a82 (patch)
treefd1d1d0cdc33225f27f052011af5d649072ef6b2 /content/browser/browser_plugin
parentea01ff29254d392ad31b28f739837b4c39bbc418 (diff)
downloadchromium_src-93f59c4e342fc2dabc56e207f5e25b993daf3a82.zip
chromium_src-93f59c4e342fc2dabc56e207f5e25b993daf3a82.tar.gz
chromium_src-93f59c4e342fc2dabc56e207f5e25b993daf3a82.tar.bz2
Browser Plugin: Minor cleanup
BrowserPluginGuest had some overly verbose code that could be simplified. BUG=None Test=Ran BrowserPluginTest.*, BrowserPluginHostTest.* Review URL: https://chromiumcodereview.appspot.com/11411185 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169729 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_plugin')
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 7d763fb..0ad537f 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -423,8 +423,7 @@ void BrowserPluginGuest::HandleInputEvent(RenderViewHost* render_view_host,
guest_rect_ = guest_rect;
RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>(
web_contents()->GetRenderViewHost());
- IPC::Message* message = new ViewMsg_HandleInputEvent(
- guest_rvh->GetRoutingID());
+ IPC::Message* message = new ViewMsg_HandleInputEvent(routing_id());
// Copy the WebInputEvent and modify the event type. The guest expects
// WebInputEvent::RawKeyDowns and not KeyDowns.
@@ -439,8 +438,7 @@ void BrowserPluginGuest::HandleInputEvent(RenderViewHost* render_view_host,
// TODO(fsamuel): What do we need to do here? This is for keyboard shortcuts.
if (input_event->type == WebKit::WebInputEvent::RawKeyDown)
message->WriteBool(false);
- bool sent = guest_rvh->Send(message);
- if (!sent) {
+ if (!Send(message)) {
// If the embedder is waiting for a previous input ack, a new input message
// won't get sent to the guest. Reply immediately with handled = false so
// embedder doesn't hang.
@@ -487,9 +485,7 @@ void BrowserPluginGuest::SetFocus(bool focused) {
if (focused_ == focused)
return;
focused_ = focused;
- RenderViewHost* render_view_host = web_contents()->GetRenderViewHost();
- render_view_host->Send(
- new ViewMsg_SetFocus(render_view_host->GetRoutingID(), focused));
+ Send(new ViewMsg_SetFocus(routing_id(), focused));
}
void BrowserPluginGuest::ShowWidget(RenderViewHost* render_view_host,
@@ -583,9 +579,7 @@ void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) {
void BrowserPluginGuest::RenderViewReady() {
// TODO(fsamuel): Investigate whether it's possible to update state earlier
// here (see http://www.crbug.com/158151).
- RenderViewHost* render_view_host = web_contents()->GetRenderViewHost();
- render_view_host->Send(
- new ViewMsg_SetFocus(render_view_host->GetRoutingID(), focused_));
+ Send(new ViewMsg_SetFocus(routing_id(), focused_));
bool embedder_visible =
embedder_web_contents_->GetBrowserPluginEmbedder()->visible();
SetVisibility(embedder_visible, visible());
@@ -631,7 +625,7 @@ void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) {
}
void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
- embedder_web_contents_->GetRenderProcessHost()->Send(msg);
+ embedder_web_contents_->Send(msg);
}
} // namespace content