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

Unified Diff: chrome/browser/ui/panels/panel_window_controller_cocoa.mm

Issue 8205017: Fix crash when reloading extension with more than one panel open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/panels/panel_window_controller_cocoa.mm
diff --git a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
index 6483664feaac724ee45a97c519578c45f2f57361..daaf1eddee42b93b18ebcd9db36dd202e2d4fba2 100644
--- a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
+++ b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
@@ -138,7 +138,9 @@ static BOOL g_reportAnimationStatus = NO;
// Attach the RenderWigetHostView to the view hierarchy, it will render
// HTML content.
- [[window contentView] addSubview:[self tabContentsView]];
+ NSView* tabContentsView = [self tabContentsView];
+ DCHECK(tabContentsView);
+ [[window contentView] addSubview:tabContentsView];
[self enableTabContentsViewAutosizing];
}
@@ -152,12 +154,18 @@ static BOOL g_reportAnimationStatus = NO;
- (void)disableTabContentsViewAutosizing {
NSView* tabContentView = [self tabContentsView];
+ if (!tabContentView)
+ return;
+
DCHECK([tabContentView superview] == [[self window] contentView]);
[tabContentView setAutoresizingMask:NSViewNotSizable];
}
- (void)enableTabContentsViewAutosizing {
NSView* tabContentView = [self tabContentsView];
+ if (!tabContentView)
+ return;
+
DCHECK([tabContentView superview] == [[self window] contentView]);
// Parent's bounds is child's frame.
@@ -247,10 +255,9 @@ static BOOL g_reportAnimationStatus = NO;
- (NSView*)tabContentsView {
TabContents* contents = windowShim_->browser()->GetSelectedTabContents();
- CHECK(contents);
- NSView* tabContentView = contents->GetNativeView();
- CHECK(tabContentView);
- return tabContentView;
+ if (contents)
+ return contents->GetNativeView();
+ return NULL;
}
- (PanelTitlebarViewCocoa*)titlebarView {
« 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