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

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

Issue 11359201: Remove TabContents from TabStripModelObserver::TabReplacedAt. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 | Annotate | Revision Log
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 "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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // anchor link location calculations to be incorrect even after a new 97 // anchor link location calculations to be incorrect even after a new
98 // layout with proper view dimensions. TabStripModel::AddTabContents() 98 // layout with proper view dimensions. TabStripModel::AddTabContents()
99 // contains similar logic. 99 // contains similar logic.
100 new_tab->GetView()->SizeContents( 100 new_tab->GetView()->SizeContents(
101 browser->window()->GetRestoredBounds().size()); 101 browser->window()->GetRestoredBounds().size());
102 new_tab->WasHidden(); 102 new_tab->WasHidden();
103 } 103 }
104 SessionService* session_service = 104 SessionService* session_service =
105 SessionServiceFactory::GetForProfileIfExisting(browser->profile()); 105 SessionServiceFactory::GetForProfileIfExisting(browser->profile());
106 if (session_service) 106 if (session_service)
107 session_service->TabRestored(tab_contents, pin); 107 session_service->TabRestored(tab_contents->web_contents(), pin);
108 return new_tab; 108 return new_tab;
109 } 109 }
110 110
111 void ReplaceRestoredTab( 111 void ReplaceRestoredTab(
112 Browser* browser, 112 Browser* browser,
113 const std::vector<TabNavigation>& navigations, 113 const std::vector<TabNavigation>& navigations,
114 int selected_navigation, 114 int selected_navigation,
115 bool from_last_session, 115 bool from_last_session,
116 const std::string& extension_app_id, 116 const std::string& extension_app_id,
117 content::SessionStorageNamespace* session_storage_namespace, 117 content::SessionStorageNamespace* session_storage_namespace,
(...skipping 28 matching lines...) Expand all
146 int insertion_index = browser->active_index(); 146 int insertion_index = browser->active_index();
147 browser->tab_strip_model()->InsertTabContentsAt( 147 browser->tab_strip_model()->InsertTabContentsAt(
148 insertion_index + 1, 148 insertion_index + 1,
149 tab_contents, 149 tab_contents,
150 TabStripModel::ADD_ACTIVE | TabStripModel::ADD_INHERIT_GROUP); 150 TabStripModel::ADD_ACTIVE | TabStripModel::ADD_INHERIT_GROUP);
151 browser->tab_strip_model()->CloseTabContentsAt( 151 browser->tab_strip_model()->CloseTabContentsAt(
152 insertion_index, TabStripModel::CLOSE_NONE); 152 insertion_index, TabStripModel::CLOSE_NONE);
153 } 153 }
154 154
155 } // namespace chrome 155 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698