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

Side by Side Diff: content/browser/web_contents/web_contents_impl.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 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 "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 // Send the new override string to the renderer. 786 // Send the new override string to the renderer.
787 RenderViewHost* host = GetRenderViewHost(); 787 RenderViewHost* host = GetRenderViewHost();
788 if (host) 788 if (host)
789 host->SyncRendererPrefs(); 789 host->SyncRendererPrefs();
790 790
791 // Reload the page if a load is currently in progress to avoid having 791 // Reload the page if a load is currently in progress to avoid having
792 // different parts of the page loaded using different user agents. 792 // different parts of the page loaded using different user agents.
793 NavigationEntry* entry = controller_.GetActiveEntry(); 793 NavigationEntry* entry = controller_.GetActiveEntry();
794 if (is_loading_ && entry != NULL && entry->GetIsOverridingUserAgent()) 794 if (is_loading_ && entry != NULL && entry->GetIsOverridingUserAgent())
795 controller_.ReloadIgnoringCache(true); 795 controller_.ReloadIgnoringCache(true);
796
797 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
798 UserAgentOverrideSet(override));
796 } 799 }
797 800
798 const std::string& WebContentsImpl::GetUserAgentOverride() const { 801 const std::string& WebContentsImpl::GetUserAgentOverride() const {
799 return renderer_preferences_.user_agent_override; 802 return renderer_preferences_.user_agent_override;
800 } 803 }
801 804
802 const string16& WebContentsImpl::GetTitle() const { 805 const string16& WebContentsImpl::GetTitle() const {
803 // Transient entries take precedence. They are used for interstitial pages 806 // Transient entries take precedence. They are used for interstitial pages
804 // that are shown on top of existing pages. 807 // that are shown on top of existing pages.
805 NavigationEntry* entry = controller_.GetTransientEntry(); 808 NavigationEntry* entry = controller_.GetTransientEntry();
(...skipping 2378 matching lines...) Expand 10 before | Expand all | Expand 10 after
3184 old_browser_plugin_host()->embedder_render_process_host(); 3187 old_browser_plugin_host()->embedder_render_process_host();
3185 *embedder_container_id = old_browser_plugin_host()->instance_id(); 3188 *embedder_container_id = old_browser_plugin_host()->instance_id();
3186 int embedder_process_id = 3189 int embedder_process_id =
3187 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; 3190 embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
3188 if (embedder_process_id != -1) { 3191 if (embedder_process_id != -1) {
3189 *embedder_channel_name = 3192 *embedder_channel_name =
3190 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), 3193 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(),
3191 embedder_process_id); 3194 embedder_process_id);
3192 } 3195 }
3193 } 3196 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698