Index: ui/platform_window/stub/stub_window.cc |
diff --git a/ui/platform_window/stub/stub_window.cc b/ui/platform_window/stub/stub_window.cc |
index a46f89d656dfe7a41f49fe855782c92ee0ea5b8f..070cddb940dcb96be78dbfd54643fad10c52eb21 100644 |
--- a/ui/platform_window/stub/stub_window.cc |
+++ b/ui/platform_window/stub/stub_window.cc |
@@ -8,8 +8,11 @@ |
namespace ui { |
-StubWindow::StubWindow(PlatformWindowDelegate* delegate) : delegate_(delegate) { |
- delegate_->OnAcceleratedWidgetAvailable(gfx::kNullAcceleratedWidget, 1.f); |
+StubWindow::StubWindow( |
+ PlatformWindowDelegate* delegate, gfx::AcceleratedWidget accelerated_widget) |
+ : delegate_(delegate) { |
+ if (delegate_) |
+ delegate_->OnAcceleratedWidgetAvailable(accelerated_widget, 1.f); |
} |
StubWindow::~StubWindow() { |
@@ -22,14 +25,16 @@ void StubWindow::Hide() { |
} |
void StubWindow::Close() { |
- delegate_->OnClosed(); |
+ if (delegate_) |
+ delegate_->OnClosed(); |
} |
void StubWindow::SetBounds(const gfx::Rect& bounds) { |
if (bounds_ == bounds) |
return; |
bounds_ = bounds; |
- delegate_->OnBoundsChanged(bounds); |
+ if (delegate_) |
+ delegate_->OnBoundsChanged(bounds); |
} |
gfx::Rect StubWindow::GetBounds() { |