Index: chrome/plugin/webplugin_delegate_stub.cc |
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc |
index 8e74aa7df290a6a4e4cb82cf67ed748a6d12837e..17f02222b28887e3e0f17ab1d65f5d94244334ba 100644 |
--- a/chrome/plugin/webplugin_delegate_stub.cc |
+++ b/chrome/plugin/webplugin_delegate_stub.cc |
@@ -337,29 +337,35 @@ void WebPluginDelegateStub::OnSendJavaScriptStream(const GURL& url, |
} |
void WebPluginDelegateStub::OnSetContentAreaFocus(bool has_focus) { |
- delegate_->SetContentAreaHasFocus(has_focus); |
+ if (delegate_) |
+ delegate_->SetContentAreaHasFocus(has_focus); |
} |
#if defined(OS_MACOSX) |
void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) { |
- delegate_->SetWindowHasFocus(has_focus); |
+ if (delegate_) |
+ delegate_->SetWindowHasFocus(has_focus); |
} |
void WebPluginDelegateStub::OnContainerHidden() { |
- delegate_->SetContainerVisibility(false); |
+ if (delegate_) |
+ delegate_->SetContainerVisibility(false); |
} |
void WebPluginDelegateStub::OnContainerShown(gfx::Rect window_frame, |
gfx::Rect view_frame, |
bool has_focus) { |
- delegate_->WindowFrameChanged(window_frame, view_frame); |
- delegate_->SetContainerVisibility(true); |
- delegate_->SetWindowHasFocus(has_focus); |
+ if (delegate_) { |
+ delegate_->WindowFrameChanged(window_frame, view_frame); |
+ delegate_->SetContainerVisibility(true); |
+ delegate_->SetWindowHasFocus(has_focus); |
+ } |
} |
void WebPluginDelegateStub::OnWindowFrameChanged(const gfx::Rect& window_frame, |
const gfx::Rect& view_frame) { |
- delegate_->WindowFrameChanged(window_frame, view_frame); |
+ if (delegate_) |
+ delegate_->WindowFrameChanged(window_frame, view_frame); |
} |
#endif // OS_MACOSX |