| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 bool from_last_session, | 43 bool from_last_session, |
| 44 content::SessionStorageNamespace* session_storage_namespace, | 44 content::SessionStorageNamespace* session_storage_namespace, |
| 45 const std::string& user_agent_override) { | 45 const std::string& user_agent_override) { |
| 46 GURL restore_url = navigations.at(selected_navigation).virtual_url(); | 46 GURL restore_url = navigations.at(selected_navigation).virtual_url(); |
| 47 // TODO(ajwong): Remove the temporary session_storage_namespace_map when | 47 // TODO(ajwong): Remove the temporary session_storage_namespace_map when |
| 48 // we teach session restore to understand that one tab can have multiple | 48 // we teach session restore to understand that one tab can have multiple |
| 49 // SessionStorageNamespace objects. Also remove the | 49 // SessionStorageNamespace objects. Also remove the |
| 50 // session_storage_namespace.h include since we only need that to assign | 50 // session_storage_namespace.h include since we only need that to assign |
| 51 // into the map. | 51 // into the map. |
| 52 content::SessionStorageNamespaceMap session_storage_namespace_map; | 52 content::SessionStorageNamespaceMap session_storage_namespace_map; |
| 53 session_storage_namespace_map[""] = session_storage_namespace; | 53 session_storage_namespace_map[std::string()] = session_storage_namespace; |
| 54 WebContents::CreateParams create_params( | 54 WebContents::CreateParams create_params( |
| 55 browser->profile(), | 55 browser->profile(), |
| 56 tab_util::GetSiteInstanceForNewTab(browser->profile(), restore_url)); | 56 tab_util::GetSiteInstanceForNewTab(browser->profile(), restore_url)); |
| 57 WebContents* base_web_contents = | 57 WebContents* base_web_contents = |
| 58 browser->tab_strip_model()->GetActiveWebContents(); | 58 browser->tab_strip_model()->GetActiveWebContents(); |
| 59 if (base_web_contents) { | 59 if (base_web_contents) { |
| 60 create_params.initial_size = | 60 create_params.initial_size = |
| 61 base_web_contents->GetView()->GetContainerSize(); | 61 base_web_contents->GetView()->GetContainerSize(); |
| 62 } | 62 } |
| 63 WebContents* web_contents = content::WebContents::CreateWithSessionStorage( | 63 WebContents* web_contents = content::WebContents::CreateWithSessionStorage( |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 TabStripModel* tab_strip = browser->tab_strip_model(); | 150 TabStripModel* tab_strip = browser->tab_strip_model(); |
| 151 int insertion_index = tab_strip->active_index(); | 151 int insertion_index = tab_strip->active_index(); |
| 152 tab_strip->InsertWebContentsAt(insertion_index + 1, | 152 tab_strip->InsertWebContentsAt(insertion_index + 1, |
| 153 web_contents, | 153 web_contents, |
| 154 TabStripModel::ADD_ACTIVE | | 154 TabStripModel::ADD_ACTIVE | |
| 155 TabStripModel::ADD_INHERIT_GROUP); | 155 TabStripModel::ADD_INHERIT_GROUP); |
| 156 tab_strip->CloseWebContentsAt(insertion_index, TabStripModel::CLOSE_NONE); | 156 tab_strip->CloseWebContentsAt(insertion_index, TabStripModel::CLOSE_NONE); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace chrome | 159 } // namespace chrome |
| OLD | NEW |