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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 7244009: Helper functions for tracking stale TabContentsDelegate's. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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
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 cc805054f208b971cb56e8f7554f03984c3bdc26..43a46f78fde0f7999694d8b0f522dd349e986aed 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -623,6 +623,19 @@ void TabContents::AddNewContents(TabContents* new_contents,
user_gesture);
}
+void TabContents::set_delegate(TabContentsDelegate* delegate) {
+ if (delegate == delegate_)
+ return;
+
+ if (delegate_)
+ delegate_->Detach(this);
+
+ delegate_ = delegate;
+
+ if (delegate_)
+ delegate_->Attach(this);
+}
+
gfx::NativeView TabContents::GetContentNativeView() const {
return view_->GetContentNativeView();
}

Powered by Google App Engine
This is Rietveld 408576698