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

Side by Side Diff: chrome/browser/ui/sad_tab_helper.cc

Issue 18339006: Rename RenderViewGone IPC/methods to better reflect reality (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for reviews by creis@ and palmer@. Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/sad_tab_helper.h ('k') | chrome/browser/ui/search/instant_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/sad_tab_helper.h" 5 #include "chrome/browser/ui/sad_tab_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/browser_shutdown.h" 8 #include "chrome/browser/browser_shutdown.h"
9 #include "chrome/browser/ui/sad_tab.h" 9 #include "chrome/browser/ui/sad_tab.h"
10 #include "content/public/browser/notification_source.h" 10 #include "content/public/browser/notification_source.h"
11 #include "content/public/browser/notification_types.h" 11 #include "content/public/browser/notification_types.h"
12 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
13 #include "content/public/browser/web_contents_view.h" 13 #include "content/public/browser/web_contents_view.h"
14 14
15 DEFINE_WEB_CONTENTS_USER_DATA_KEY(SadTabHelper); 15 DEFINE_WEB_CONTENTS_USER_DATA_KEY(SadTabHelper);
16 16
17 SadTabHelper::~SadTabHelper() { 17 SadTabHelper::~SadTabHelper() {
18 } 18 }
19 19
20 SadTabHelper::SadTabHelper(content::WebContents* web_contents) 20 SadTabHelper::SadTabHelper(content::WebContents* web_contents)
21 : content::WebContentsObserver(web_contents) { 21 : content::WebContentsObserver(web_contents) {
22 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, 22 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED,
23 content::Source<content::WebContents>(web_contents)); 23 content::Source<content::WebContents>(web_contents));
24 } 24 }
25 25
26 void SadTabHelper::RenderViewGone(base::TerminationStatus status) { 26 void SadTabHelper::RenderProcessGone(base::TerminationStatus status) {
27 // Only show the sad tab if we're not in browser shutdown, so that WebContents 27 // Only show the sad tab if we're not in browser shutdown, so that WebContents
28 // objects that are not in a browser (e.g., HTML dialogs) and thus are 28 // objects that are not in a browser (e.g., HTML dialogs) and thus are
29 // visible do not flash a sad tab page. 29 // visible do not flash a sad tab page.
30 if (browser_shutdown::GetShutdownType() != browser_shutdown::NOT_VALID) 30 if (browser_shutdown::GetShutdownType() != browser_shutdown::NOT_VALID)
31 return; 31 return;
32 32
33 if (sad_tab_) 33 if (sad_tab_)
34 return; 34 return;
35 35
36 if (chrome::SadTab::ShouldShow(status)) 36 if (chrome::SadTab::ShouldShow(status))
(...skipping 10 matching lines...) Expand all
47 } 47 }
48 } 48 }
49 49
50 void SadTabHelper::InstallSadTab(base::TerminationStatus status) { 50 void SadTabHelper::InstallSadTab(base::TerminationStatus status) {
51 chrome::SadTabKind kind = 51 chrome::SadTabKind kind =
52 (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED) ? 52 (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED) ?
53 chrome::SAD_TAB_KIND_KILLED : chrome::SAD_TAB_KIND_CRASHED; 53 chrome::SAD_TAB_KIND_KILLED : chrome::SAD_TAB_KIND_CRASHED;
54 sad_tab_.reset(chrome::SadTab::Create(web_contents(), kind)); 54 sad_tab_.reset(chrome::SadTab::Create(web_contents(), kind));
55 sad_tab_->Show(); 55 sad_tab_->Show();
56 } 56 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/sad_tab_helper.h ('k') | chrome/browser/ui/search/instant_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698