Commit b8cd8703 authored by avi@chromium.org's avatar avi@chromium.org

Remove notifications from the sad tab helper.

BUG=170921
TEST=no change

Review URL: https://chromiumcodereview.appspot.com/23684030

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221304 0039d316-1c4b-4281-b951-d872f2087c98
parent 2a0ff283
......@@ -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) ?
......
......@@ -8,8 +8,6 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
......@@ -19,7 +17,6 @@ class SadTab;
// Per-tab class to manage sad tab views.
class SadTabHelper : public content::WebContentsObserver,
public content::NotificationObserver,
public content::WebContentsUserData<SadTabHelper> {
public:
virtual ~SadTabHelper();
......@@ -34,16 +31,9 @@ class SadTabHelper : public content::WebContentsObserver,
void InstallSadTab(base::TerminationStatus status);
// Overridden from content::WebContentsObserver:
virtual void RenderViewReady() OVERRIDE;
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
// Overridden from content::NotificationObserver:
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
// Used to get notifications about renderers coming and going.
content::NotificationRegistrar registrar_;
scoped_ptr<chrome::SadTab> sad_tab_;
DISALLOW_COPY_AND_ASSIGN(SadTabHelper);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment