summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/toolbar_view.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-20 19:11:15 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-20 19:11:15 +0000
commit95ddfec29679e3a1b831274c42a23f517df62259 (patch)
tree6d39400c18d342f3d8610f24be147e79c15d7078 /chrome/browser/ui/views/toolbar_view.cc
parent5bd5a920fa8ea930620fef26cc7e8d48ed9830ab (diff)
downloadchromium_src-95ddfec29679e3a1b831274c42a23f517df62259.zip
chromium_src-95ddfec29679e3a1b831274c42a23f517df62259.tar.gz
chromium_src-95ddfec29679e3a1b831274c42a23f517df62259.tar.bz2
Attempt at hiding the crash seen on ChromeOS in ToolbarView::PopupTopSpacing. I don't understand the circumstances behind it occurring but this change should be pretty harmless.
BUG=76064 TEST=none Review URL: http://codereview.chromium.org/6777013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82343 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/toolbar_view.cc')
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 803c336..c0d4bdb 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -646,14 +646,15 @@ bool ToolbarView::ShouldShowIncompatibilityWarning() {
}
int ToolbarView::PopupTopSpacing() const {
-#if defined(OS_CHROMEOS)
- CHECK(parent());
- CHECK(const_cast<ToolbarView*>(this)->GetRootView());
- CHECK(GetWidget());
- CHECK(GetWindow());
- CHECK(GetWindow()->non_client_view());
-#endif
- return GetWindow()->non_client_view()->UseNativeFrame() ?
+ // TODO(beng): For some reason GetWindow() returns NULL here in some
+ // unidentified circumstances on ChromeOS. This means GetWidget()
+ // succeeded but we were (probably) unable to locate a WidgetGtk*
+ // on it using NativeWidget::GetNativeWidgetForNativeView.
+ // I am throwing in a NULL check for now to stop the hurt, but
+ // it's possible the crash may just show up somewhere else.
+ const views::Window* window = GetWindow();
+ DCHECK(window) << "If you hit this please talk to beng";
+ return window && window->non_client_view()->UseNativeFrame() ?
0 : kPopupTopSpacingNonGlass;
}