| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |