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

Unified Diff: chrome/browser/ui/sad_tab_helper.cc

Issue 23684030: Remove notifications from the sad tab helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « chrome/browser/ui/sad_tab_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sad_tab_helper.cc
diff --git a/chrome/browser/ui/sad_tab_helper.cc b/chrome/browser/ui/sad_tab_helper.cc
index dfcb1cfcb00280869a0ee42024afdb2c53d5d027..8ad27ece6ab4acc5cd3fcd8e29f05fc607a56468 100644
--- a/chrome/browser/ui/sad_tab_helper.cc
+++ b/chrome/browser/ui/sad_tab_helper.cc
@@ -7,8 +7,6 @@
#include "base/logging.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/ui/sad_tab.h"
-#include "content/public/browser/notification_source.h"
-#include "content/public/browser/notification_types.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
@@ -19,8 +17,13 @@ SadTabHelper::~SadTabHelper() {
SadTabHelper::SadTabHelper(content::WebContents* web_contents)
: content::WebContentsObserver(web_contents) {
- registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED,
- content::Source<content::WebContents>(web_contents));
+}
+
+void SadTabHelper::RenderViewReady() {
+ if (sad_tab_) {
+ sad_tab_->Close();
+ sad_tab_.reset();
+ }
}
void SadTabHelper::RenderProcessGone(base::TerminationStatus status) {
@@ -37,16 +40,6 @@ void SadTabHelper::RenderProcessGone(base::TerminationStatus status) {
InstallSadTab(status);
}
-void SadTabHelper::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_CONNECTED, type);
- if (sad_tab_) {
- sad_tab_->Close();
- sad_tab_.reset();
- }
-}
-
void SadTabHelper::InstallSadTab(base::TerminationStatus status) {
chrome::SadTabKind kind =
(status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED) ?
« no previous file with comments | « chrome/browser/ui/sad_tab_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698