Index: chrome/browser/sessions/session_tab_helper.cc |
diff --git a/chrome/browser/sessions/session_tab_helper.cc b/chrome/browser/sessions/session_tab_helper.cc |
index 2314afdfe737314292971203a05a1e490ae6a90b..710e316f08bccf489f2ad4b3b8c8504844bab8d4 100644 |
--- a/chrome/browser/sessions/session_tab_helper.cc |
+++ b/chrome/browser/sessions/session_tab_helper.cc |
@@ -19,9 +19,24 @@ SessionTabHelper::SessionTabHelper(content::WebContents* contents) |
: content::WebContentsObserver(contents) { |
} |
-SessionTabHelper::~SessionTabHelper() { |
+SessionTabHelper::SessionTabHelper(content::WebContents* contents, |
+ const SessionID& id) |
+ : content::WebContentsObserver(contents), session_id_(id) {} |
sky
2013/05/22 00:46:36
nit: since the constructor wrapped one param on ea
|
+ |
+// static |
+void SessionTabHelper::CreateForWebContentsWithId( |
+ content::WebContents* contents, |
+ const SessionID& id) { |
+ DCHECK(contents); |
+ if (FromWebContents(contents)) { |
+ DCHECK_EQ(id.id(), FromWebContents(contents)->session_id().id()); |
+ return; |
+ } |
+ contents->SetUserData(UserDataKey(), new SessionTabHelper(contents, id)); |
} |
+SessionTabHelper::~SessionTabHelper() {} |
+ |
void SessionTabHelper::SetWindowID(const SessionID& id) { |
window_id_ = id; |