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/ui/browser_tabrestore.h" | 5 #include "chrome/browser/ui/browser_tabrestore.h" |
6 | 6 |
7 #include "chrome/browser/extensions/tab_helper.h" | 7 #include "chrome/browser/extensions/tab_helper.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/sessions/session_service.h" | 9 #include "chrome/browser/sessions/session_service.h" |
10 #include "chrome/browser/sessions/session_service_factory.h" | 10 #include "chrome/browser/sessions/session_service_factory.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 if (base_web_contents) { | 64 if (base_web_contents) { |
65 create_params.initial_size = | 65 create_params.initial_size = |
66 base_web_contents->GetContainerBounds().size(); | 66 base_web_contents->GetContainerBounds().size(); |
67 } | 67 } |
68 WebContents* web_contents = content::WebContents::CreateWithSessionStorage( | 68 WebContents* web_contents = content::WebContents::CreateWithSessionStorage( |
69 create_params, | 69 create_params, |
70 session_storage_namespace_map); | 70 session_storage_namespace_map); |
71 extensions::TabHelper::CreateForWebContents(web_contents); | 71 extensions::TabHelper::CreateForWebContents(web_contents); |
72 extensions::TabHelper::FromWebContents(web_contents)-> | 72 extensions::TabHelper::FromWebContents(web_contents)-> |
73 SetExtensionAppById(extension_app_id); | 73 SetExtensionAppById(extension_app_id); |
74 std::vector<scoped_ptr<NavigationEntry>> entries = | 74 std::vector<std::unique_ptr<NavigationEntry>> entries = |
75 ContentSerializedNavigationBuilder::ToNavigationEntries( | 75 ContentSerializedNavigationBuilder::ToNavigationEntries( |
76 navigations, browser->profile()); | 76 navigations, browser->profile()); |
77 web_contents->SetUserAgentOverride(user_agent_override); | 77 web_contents->SetUserAgentOverride(user_agent_override); |
78 web_contents->GetController().Restore( | 78 web_contents->GetController().Restore( |
79 selected_navigation, GetRestoreType(browser, from_last_session), | 79 selected_navigation, GetRestoreType(browser, from_last_session), |
80 &entries); | 80 &entries); |
81 DCHECK_EQ(0u, entries.size()); | 81 DCHECK_EQ(0u, entries.size()); |
82 | 82 |
83 return web_contents; | 83 return web_contents; |
84 } | 84 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 int insertion_index = tab_strip->active_index(); | 161 int insertion_index = tab_strip->active_index(); |
162 tab_strip->InsertWebContentsAt(insertion_index + 1, | 162 tab_strip->InsertWebContentsAt(insertion_index + 1, |
163 web_contents, | 163 web_contents, |
164 TabStripModel::ADD_ACTIVE | | 164 TabStripModel::ADD_ACTIVE | |
165 TabStripModel::ADD_INHERIT_GROUP); | 165 TabStripModel::ADD_INHERIT_GROUP); |
166 tab_strip->CloseWebContentsAt(insertion_index, TabStripModel::CLOSE_NONE); | 166 tab_strip->CloseWebContentsAt(insertion_index, TabStripModel::CLOSE_NONE); |
167 return web_contents; | 167 return web_contents; |
168 } | 168 } |
169 | 169 |
170 } // namespace chrome | 170 } // namespace chrome |
OLD | NEW |