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

Unified Diff: chrome/browser/ui/browser_tabrestore.cc

Issue 10827168: Fix user agent override restore pipeline (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Nit addressing Created 8 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_tabrestore.cc
diff --git a/chrome/browser/ui/browser_tabrestore.cc b/chrome/browser/ui/browser_tabrestore.cc
index cb184a355fc0d492a050152869b634fc4d379c57..566cb863865c01647d3154c57bb697cff00152b7 100644
--- a/chrome/browser/ui/browser_tabrestore.cc
+++ b/chrome/browser/ui/browser_tabrestore.cc
@@ -40,7 +40,8 @@ content::WebContents* AddRestoredTab(
bool select,
bool pin,
bool from_last_session,
- content::SessionStorageNamespace* session_storage_namespace) {
+ content::SessionStorageNamespace* session_storage_namespace,
+ const std::string& user_agent_override) {
GURL restore_url = navigations.at(selected_navigation).virtual_url();
// TODO(ajwong): Remove the temporary session_storage_namespace_map when
// we teach session restore to understand that one tab can have multiple
@@ -60,6 +61,7 @@ content::WebContents* AddRestoredTab(
std::vector<NavigationEntry*> entries;
TabNavigation::CreateNavigationEntriesFromTabNavigations(
browser->profile(), navigations, &entries);
+ new_tab->SetUserAgentOverride(user_agent_override);
new_tab->GetController().Restore(
selected_navigation, from_last_session, &entries);
DCHECK_EQ(0u, entries.size());
@@ -100,7 +102,8 @@ void ReplaceRestoredTab(
int selected_navigation,
bool from_last_session,
const std::string& extension_app_id,
- content::SessionStorageNamespace* session_storage_namespace) {
+ content::SessionStorageNamespace* session_storage_namespace,
+ const std::string& user_agent_override) {
GURL restore_url = navigations.at(selected_navigation).virtual_url();
// TODO(ajwong): Remove the temporary session_storage_namespace_map when
// we teach session restore to understand that one tab can have multiple
@@ -117,6 +120,7 @@ void ReplaceRestoredTab(
session_storage_namespace_map);
tab_contents->extension_tab_helper()->SetExtensionAppById(extension_app_id);
WebContents* replacement = tab_contents->web_contents();
+ replacement->SetUserAgentOverride(user_agent_override);
std::vector<NavigationEntry*> entries;
TabNavigation::CreateNavigationEntriesFromTabNavigations(
browser->profile(), navigations, &entries);

Powered by Google App Engine
This is Rietveld 408576698