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

Side by Side Diff: chrome/browser/sessions/session_restore_android.cc

Issue 103213015: Pass through the parent_tab_id when creating a new tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/android/tab_model/tab_model.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sessions/session_restore.h" 5 #include "chrome/browser/sessions/session_restore.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "chrome/browser/android/tab_android.h" 9 #include "chrome/browser/android/tab_android.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 21 matching lines...) Expand all
32 sessions::SerializedNavigationEntry::ToNavigationEntries( 32 sessions::SerializedNavigationEntry::ToNavigationEntries(
33 session_tab.navigations, profile); 33 session_tab.navigations, profile);
34 content::WebContents* new_web_contents = content::WebContents::Create( 34 content::WebContents* new_web_contents = content::WebContents::Create(
35 content::WebContents::CreateParams(context)); 35 content::WebContents::CreateParams(context));
36 int selected_index = session_tab.normalized_navigation_index(); 36 int selected_index = session_tab.normalized_navigation_index();
37 new_web_contents->GetController().Restore( 37 new_web_contents->GetController().Restore(
38 selected_index, 38 selected_index,
39 content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY, 39 content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY,
40 &entries); 40 &entries);
41 41
42 TabAndroid* current_tab = TabAndroid::FromWebContents(web_contents);
David Trainor- moved to gerrit 2014/01/07 19:29:30 Are we sure this can't be null in the new foregrou
aurimas (slooooooooow) 2014/01/07 19:41:26 SessionRestore::RestoreForeignSessionTab() is call
43 DCHECK(current_tab);
42 if (disposition == CURRENT_TAB) { 44 if (disposition == CURRENT_TAB) {
43 TabAndroid* current_tab = TabAndroid::FromWebContents(web_contents);
44 DCHECK(current_tab);
45 current_tab->SwapTabContents(web_contents, new_web_contents); 45 current_tab->SwapTabContents(web_contents, new_web_contents);
46 delete web_contents; 46 delete web_contents;
47 } else { 47 } else {
48 DCHECK(disposition == NEW_FOREGROUND_TAB || 48 DCHECK(disposition == NEW_FOREGROUND_TAB ||
49 disposition == NEW_BACKGROUND_TAB); 49 disposition == NEW_BACKGROUND_TAB);
50 tab_model->CreateTab(new_web_contents); 50 tab_model->CreateTab(new_web_contents, current_tab->GetAndroidId());
51 } 51 }
52 return new_web_contents; 52 return new_web_contents;
53 } 53 }
54 54
55 // static 55 // static
56 std::vector<Browser*> SessionRestore::RestoreForeignSessionWindows( 56 std::vector<Browser*> SessionRestore::RestoreForeignSessionWindows(
57 Profile* profile, 57 Profile* profile,
58 chrome::HostDesktopType host_desktop_type, 58 chrome::HostDesktopType host_desktop_type,
59 std::vector<const SessionWindow*>::const_iterator begin, 59 std::vector<const SessionWindow*>::const_iterator begin,
60 std::vector<const SessionWindow*>::const_iterator end) { 60 std::vector<const SessionWindow*>::const_iterator end) {
61 NOTREACHED(); 61 NOTREACHED();
62 return std::vector<Browser*>(); 62 return std::vector<Browser*>();
63 } 63 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/android/tab_model/tab_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698