Commit 48efb6ca authored by aurimas@chromium.org's avatar aurimas@chromium.org

Pass through the parent_tab_id when creating a new tab.

BUG=328080
NOTRY=true

Review URL: https://codereview.chromium.org/103213015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243424 0039d316-1c4b-4281-b951-d872f2087c98
parent 59953980
...@@ -39,15 +39,15 @@ content::WebContents* SessionRestore::RestoreForeignSessionTab( ...@@ -39,15 +39,15 @@ content::WebContents* SessionRestore::RestoreForeignSessionTab(
content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY, content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY,
&entries); &entries);
TabAndroid* current_tab = TabAndroid::FromWebContents(web_contents);
DCHECK(current_tab);
if (disposition == CURRENT_TAB) { if (disposition == CURRENT_TAB) {
TabAndroid* current_tab = TabAndroid::FromWebContents(web_contents);
DCHECK(current_tab);
current_tab->SwapTabContents(web_contents, new_web_contents); current_tab->SwapTabContents(web_contents, new_web_contents);
delete web_contents; delete web_contents;
} else { } else {
DCHECK(disposition == NEW_FOREGROUND_TAB || DCHECK(disposition == NEW_FOREGROUND_TAB ||
disposition == NEW_BACKGROUND_TAB); disposition == NEW_BACKGROUND_TAB);
tab_model->CreateTab(new_web_contents); tab_model->CreateTab(new_web_contents, current_tab->GetAndroidId());
} }
return new_web_contents; return new_web_contents;
} }
......
...@@ -47,7 +47,8 @@ class TabModel : public content::NotificationObserver { ...@@ -47,7 +47,8 @@ class TabModel : public content::NotificationObserver {
virtual void CloseTabAt(int index) = 0; virtual void CloseTabAt(int index) = 0;
// Used for restoring tabs from synced foreign sessions. // Used for restoring tabs from synced foreign sessions.
virtual void CreateTab(content::WebContents* web_contents) = 0; virtual void CreateTab(content::WebContents* web_contents,
int parent_tab_id) = 0;
// Used by Developer Tools to create a new tab with a given URL. // Used by Developer Tools to create a new tab with a given URL.
// Replaces CreateTabForTesting. // Replaces CreateTabForTesting.
......
...@@ -34,7 +34,8 @@ class TestTabModel : public TabModel { ...@@ -34,7 +34,8 @@ class TestTabModel : public TabModel {
virtual content::WebContents* GetWebContentsAt(int index) const OVERRIDE { virtual content::WebContents* GetWebContentsAt(int index) const OVERRIDE {
return NULL; return NULL;
} }
virtual void CreateTab(content::WebContents* web_contents) OVERRIDE {} virtual void CreateTab(content::WebContents* web_contents,
int parent_tab_id) OVERRIDE {}
virtual content::WebContents* CreateNewTabForDevTools( virtual content::WebContents* CreateNewTabForDevTools(
const GURL& url) OVERRIDE { const GURL& url) OVERRIDE {
return NULL; return NULL;
......
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