From e879b4cc82c94586d95035df86357291f88e1c33 Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Mon, 11 Jul 2011 23:13:04 +0000 Subject: Fix a chrome browser crash which occurs when displaying the page info bubble in a ChromeFrame page. The crash occurs while dereferencing a NULL NonClientView member in the widget code. This member is only instantiated if the widget is of type InitParams::TYPE_WINDOW. ChromeFrame always instantiates as a popup window and hence this member is always NULL. Fix is to add a NULL check at the relevant places in the widget code. Fixes bug http://code.google.com/p/chromium/issues/detail?id=88960 BUG=88960 Review URL: http://codereview.chromium.org/7301028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92071 0039d316-1c4b-4281-b951-d872f2087c98 --- views/widget/widget.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'views') diff --git a/views/widget/widget.cc b/views/widget/widget.cc index 51bafb0..0166339 100644 --- a/views/widget/widget.cc +++ b/views/widget/widget.cc @@ -446,7 +446,8 @@ bool Widget::IsActive() const { void Widget::DisableInactiveRendering() { disable_inactive_rendering_ = true; - non_client_view_->DisableInactiveRendering(disable_inactive_rendering_); + if (non_client_view_) + non_client_view_->DisableInactiveRendering(disable_inactive_rendering_); } void Widget::SetAlwaysOnTop(bool on_top) { @@ -598,7 +599,8 @@ void Widget::UpdateWindowTitle() { } void Widget::UpdateWindowIcon() { - non_client_view_->UpdateWindowIcon(); + if (non_client_view_) + non_client_view_->UpdateWindowIcon(); native_widget_->SetWindowIcons(widget_delegate_->GetWindowIcon(), widget_delegate_->GetWindowAppIcon()); } @@ -727,7 +729,8 @@ bool Widget::IsInactiveRenderingDisabled() const { void Widget::EnableInactiveRendering() { disable_inactive_rendering_ = false; - non_client_view_->DisableInactiveRendering(false); + if (non_client_view_) + non_client_view_->DisableInactiveRendering(false); } void Widget::OnNativeWidgetActivationChanged(bool active) { @@ -815,7 +818,8 @@ void Widget::OnNativeWidgetPaint(gfx::Canvas* canvas) { } int Widget::GetNonClientComponent(const gfx::Point& point) { - return non_client_view_->NonClientHitTest(point); + return non_client_view_ ? non_client_view_->NonClientHitTest(point) + : HTNOWHERE; } bool Widget::OnKeyEvent(const KeyEvent& event) { -- cgit v1.1