diff options
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_view_mac.h | 4 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_view_mac.mm | 22 |
2 files changed, 12 insertions, 14 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.h b/chrome/browser/tab_contents/tab_contents_view_mac.h index c3801a7..1e8e174b 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.h +++ b/chrome/browser/tab_contents/tab_contents_view_mac.h @@ -19,7 +19,7 @@ class FilePath; class FindBarMac; @class FocusTracker; -@class SadTabView; +@class SadTabController; class TabContentsViewMac; @class WebDragSource; @class WebDropTarget; @@ -101,7 +101,7 @@ class TabContentsViewMac : public TabContentsView, // Used to render the sad tab. This will be non-NULL only when the sad tab is // visible. - scoped_nsobject<SadTabView> sad_tab_; + scoped_nsobject<SadTabController> sad_tab_; // The page content's intrinsic width. int preferred_width_; diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index 14b16c6..8c1f3d6 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -14,7 +14,7 @@ #import "chrome/browser/cocoa/chrome_browser_window.h" #import "chrome/browser/cocoa/browser_window_controller.h" #include "chrome/browser/global_keyboard_shortcuts_mac.h" -#include "chrome/browser/cocoa/sad_tab_view.h" +#include "chrome/browser/cocoa/sad_tab_controller.h" #import "chrome/browser/cocoa/web_drag_source.h" #import "chrome/browser/cocoa/web_drop_target.h" #include "chrome/browser/renderer_host/render_view_host_factory.h" @@ -158,13 +158,14 @@ void TabContentsViewMac::SetPageTitle(const std::wstring& title) { void TabContentsViewMac::OnTabCrashed() { if (!sad_tab_.get()) { - SadTabView* view = [[SadTabView alloc] initWithFrame:NSZeroRect]; - sad_tab_.reset(view); - - // Set as the dominant child. - [cocoa_view_.get() addSubview:view]; - [view setFrame:[cocoa_view_.get() bounds]]; - [view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + TabContents* contents = tab_contents(); + DCHECK(contents); + if (contents) { + SadTabController* sad_tab = + [[SadTabController alloc] initWithTabContents:contents + superview:cocoa_view_]; + sad_tab_.reset(sad_tab); + } } } @@ -295,10 +296,7 @@ void TabContentsViewMac::Observe(NotificationType type, const NotificationDetails& details) { switch (type.value) { case NotificationType::TAB_CONTENTS_CONNECTED: { - if (sad_tab_.get()) { - [sad_tab_.get() removeFromSuperview]; - sad_tab_.reset(); - } + sad_tab_.reset(); break; } default: |