Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4564)

Unified Diff: chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc

Issue 6992031: Fixed a crash involving popup windows in compact nav mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixed nits, comments. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
===================================================================
--- chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc (revision 86419)
+++ chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc (working copy)
@@ -90,6 +90,9 @@
: host_(host),
browser_view_(view),
observing_(false) {
+ DCHECK(host_);
+ DCHECK(browser_view_);
+ DCHECK(browser_view_->GetWidget());
top_level_window_ = browser_view_->GetWidget()->GetNativeView();
}
@@ -163,8 +166,10 @@
if (HitOnScreen(host_->view(), p)) {
return false;
}
- // Treat the bookmark as a content area when it in detached mode.
- if (browser_view_->GetBookmarkBarView()->IsDetached() &&
+ // Treat the bookmark as a content area when it in detached mode. We must
+ // check the view itself as it can be NULL for example in popup windows.
+ if (browser_view_->GetBookmarkBarView() &&
+ browser_view_->GetBookmarkBarView()->IsDetached() &&
browser_view_->IsBookmarkBarVisible() &&
HitOnScreen(browser_view_->GetBookmarkBarView(), p)) {
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698