| OLD | NEW |
| 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 "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/sessions/session_types.h" | 8 #include "chrome/browser/sessions/session_types.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 WindowOpenDisposition disposition) { | 23 WindowOpenDisposition disposition) { |
| 24 DCHECK(session_tab.navigations.size() > 0); | 24 DCHECK(session_tab.navigations.size() > 0); |
| 25 content::BrowserContext* context = web_contents->GetBrowserContext(); | 25 content::BrowserContext* context = web_contents->GetBrowserContext(); |
| 26 Profile* profile = Profile::FromBrowserContext(context); | 26 Profile* profile = Profile::FromBrowserContext(context); |
| 27 TabModel* tab_model = TabModelList::GetTabModelWithProfile(profile); | 27 TabModel* tab_model = TabModelList::GetTabModelWithProfile(profile); |
| 28 DCHECK(tab_model); | 28 DCHECK(tab_model); |
| 29 std::vector<content::NavigationEntry*> entries; | 29 std::vector<content::NavigationEntry*> entries; |
| 30 TabNavigation::CreateNavigationEntriesFromTabNavigations( | 30 TabNavigation::CreateNavigationEntriesFromTabNavigations( |
| 31 profile, session_tab.navigations, &entries); | 31 profile, session_tab.navigations, &entries); |
| 32 content::WebContents* new_web_contents = content::WebContents::Create( | 32 content::WebContents* new_web_contents = content::WebContents::Create( |
| 33 context, NULL, MSG_ROUTING_NONE, 0, 0); | 33 context, NULL, MSG_ROUTING_NONE, NULL); |
| 34 int selected_index = session_tab.normalized_navigation_index(); | 34 int selected_index = session_tab.normalized_navigation_index(); |
| 35 new_web_contents->GetController().Restore(selected_index, | 35 new_web_contents->GetController().Restore(selected_index, |
| 36 true, /* from_last_session */ | 36 true, /* from_last_session */ |
| 37 &entries); | 37 &entries); |
| 38 tab_model->CreateTab(new_web_contents); | 38 tab_model->CreateTab(new_web_contents); |
| 39 } | 39 } |
| 40 | 40 |
| 41 // static | 41 // static |
| 42 void SessionRestore::RestoreForeignSessionWindows( | 42 void SessionRestore::RestoreForeignSessionWindows( |
| 43 Profile* profile, | 43 Profile* profile, |
| 44 std::vector<const SessionWindow*>::const_iterator begin, | 44 std::vector<const SessionWindow*>::const_iterator begin, |
| 45 std::vector<const SessionWindow*>::const_iterator end) { | 45 std::vector<const SessionWindow*>::const_iterator end) { |
| 46 NOTREACHED(); | 46 NOTREACHED(); |
| 47 } | 47 } |
| OLD | NEW |