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

Side by Side Diff: chrome/browser/ui/browser_tabrestore.cc

Issue 1440573003: Remove ScopedVector from NavigationController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 5 years, 1 month 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
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/ui/browser_tabrestore.h" 5 #include "chrome/browser/ui/browser_tabrestore.h"
6 6
7 #include "base/memory/scoped_vector.h"
8 #include "chrome/browser/extensions/tab_helper.h" 7 #include "chrome/browser/extensions/tab_helper.h"
9 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/sessions/session_service.h" 9 #include "chrome/browser/sessions/session_service.h"
11 #include "chrome/browser/sessions/session_service_factory.h" 10 #include "chrome/browser/sessions/session_service_factory.h"
12 #include "chrome/browser/tab_contents/tab_util.h" 11 #include "chrome/browser/tab_contents/tab_util.h"
13 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_window.h" 13 #include "chrome/browser/ui/browser_window.h"
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" 14 #include "chrome/browser/ui/tabs/tab_strip_model.h"
16 #include "chrome/browser/ui/web_contents_sizer.h" 15 #include "chrome/browser/ui/web_contents_sizer.h"
17 #include "components/sessions/content/content_serialized_navigation_builder.h" 16 #include "components/sessions/content/content_serialized_navigation_builder.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 if (base_web_contents) { 64 if (base_web_contents) {
66 create_params.initial_size = 65 create_params.initial_size =
67 base_web_contents->GetContainerBounds().size(); 66 base_web_contents->GetContainerBounds().size();
68 } 67 }
69 WebContents* web_contents = content::WebContents::CreateWithSessionStorage( 68 WebContents* web_contents = content::WebContents::CreateWithSessionStorage(
70 create_params, 69 create_params,
71 session_storage_namespace_map); 70 session_storage_namespace_map);
72 extensions::TabHelper::CreateForWebContents(web_contents); 71 extensions::TabHelper::CreateForWebContents(web_contents);
73 extensions::TabHelper::FromWebContents(web_contents)-> 72 extensions::TabHelper::FromWebContents(web_contents)->
74 SetExtensionAppById(extension_app_id); 73 SetExtensionAppById(extension_app_id);
75 ScopedVector<NavigationEntry> scoped_entries = 74 std::vector<scoped_ptr<NavigationEntry>> entries =
76 ContentSerializedNavigationBuilder::ToNavigationEntries( 75 ContentSerializedNavigationBuilder::ToNavigationEntries(
77 navigations, browser->profile()); 76 navigations, browser->profile());
78 web_contents->SetUserAgentOverride(user_agent_override); 77 web_contents->SetUserAgentOverride(user_agent_override);
79 web_contents->GetController().Restore( 78 web_contents->GetController().Restore(
80 selected_navigation, GetRestoreType(browser, from_last_session), 79 selected_navigation, GetRestoreType(browser, from_last_session),
81 &scoped_entries); 80 &entries);
82 DCHECK_EQ(0u, scoped_entries.size()); 81 DCHECK_EQ(0u, entries.size());
83 82
84 return web_contents; 83 return web_contents;
85 } 84 }
86 85
87 } // namespace 86 } // namespace
88 87
89 content::WebContents* AddRestoredTab( 88 content::WebContents* AddRestoredTab(
90 Browser* browser, 89 Browser* browser,
91 const std::vector<SerializedNavigationEntry>& navigations, 90 const std::vector<SerializedNavigationEntry>& navigations,
92 int tab_index, 91 int tab_index,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 int insertion_index = tab_strip->active_index(); 161 int insertion_index = tab_strip->active_index();
163 tab_strip->InsertWebContentsAt(insertion_index + 1, 162 tab_strip->InsertWebContentsAt(insertion_index + 1,
164 web_contents, 163 web_contents,
165 TabStripModel::ADD_ACTIVE | 164 TabStripModel::ADD_ACTIVE |
166 TabStripModel::ADD_INHERIT_GROUP); 165 TabStripModel::ADD_INHERIT_GROUP);
167 tab_strip->CloseWebContentsAt(insertion_index, TabStripModel::CLOSE_NONE); 166 tab_strip->CloseWebContentsAt(insertion_index, TabStripModel::CLOSE_NONE);
168 return web_contents; 167 return web_contents;
169 } 168 }
170 169
171 } // namespace chrome 170 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698