| Index: content/browser/tab_contents/tab_contents.cc
|
| diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
|
| index 200d80fea880fb8ec3412cec32a72e2bf35f88ce..c167bfe8c152b7ef61bfd70e28043664944658ee 100644
|
| --- a/content/browser/tab_contents/tab_contents.cc
|
| +++ b/content/browser/tab_contents/tab_contents.cc
|
| @@ -254,6 +254,19 @@ TabContents::~TabContents() {
|
| FOR_EACH_OBSERVER(TabContentsObserver, observers_, TabContentsDestroyed());
|
|
|
| net::NetworkChangeNotifier::RemoveOnlineStateObserver(this);
|
| +
|
| + set_delegate(NULL);
|
| +}
|
| +
|
| +// TODO(cbentzel): Either remove the debugging code, or rename to SetDelegate.
|
| +void TabContents::set_delegate(TabContentsDelegate* delegate) {
|
| + if (delegate == delegate_)
|
| + return;
|
| + if (delegate_)
|
| + delegate_->Detach(this);
|
| + delegate_ = delegate;
|
| + if (delegate_)
|
| + delegate_->Attach(this);
|
| }
|
|
|
| void TabContents::AddObservers() {
|
|
|