summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-13 17:50:32 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-13 17:50:32 +0000
commit44392c6cce164e4b54df6a17fdf41a08ab55b7f1 (patch)
treee7f8f20f246b3ce40bfbda1af402e566ac2cace1
parent4672e7cac0ee05f86d516d7b23b75aa7c00a6879 (diff)
downloadchromium_src-44392c6cce164e4b54df6a17fdf41a08ab55b7f1.zip
chromium_src-44392c6cce164e4b54df6a17fdf41a08ab55b7f1.tar.gz
chromium_src-44392c6cce164e4b54df6a17fdf41a08ab55b7f1.tar.bz2
touchui: Fix showing sad tabs.
BUG=sad tab (e.g. about:crash) does not work. TEST=about:crash works Review URL: http://codereview.chromium.org/5698007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69015 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc12
-rw-r--r--chrome/browser/ui/views/tab_contents/tab_contents_view_views.h2
2 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
index 3fed4e7..ac91ccc 100644
--- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
@@ -84,9 +84,8 @@ RenderWidgetHostView* TabContentsViewViews::CreateViewForWidget(
// If we were showing sad tab, remove it now.
if (sad_tab_ != NULL) {
- RemoveChildView(sad_tab_);
- AddChildView(new views::View());
- sad_tab_ = NULL;
+ RemoveChildView(sad_tab_.get());
+ sad_tab_.reset();
}
RenderWidgetHostViewViews* view =
@@ -132,6 +131,13 @@ void TabContentsViewViews::SetPageTitle(const std::wstring& title) {
}
void TabContentsViewViews::OnTabCrashed() {
+ if (sad_tab_ != NULL)
+ return;
+
+ sad_tab_.reset(new SadTabView(tab_contents()));
+ RemoveAllChildViews(true);
+ AddChildView(sad_tab_.get());
+ Layout();
}
void TabContentsViewViews::SizeContents(const gfx::Size& size) {
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h
index 0512c42..ab0e666 100644
--- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h
@@ -101,7 +101,7 @@ class TabContentsViewViews : public TabContentsView, public views::View {
// Used to render the sad tab. This will be non-NULL only when the sad tab is
// visible.
- SadTabView* sad_tab_;
+ scoped_ptr<SadTabView> sad_tab_;
// Whether to ignore the next CHAR keyboard event.
bool ignore_next_char_event_;