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 "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 Loading... | |
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 // Alert the observer that the user agent was changed. | |
jam
2012/08/17 16:02:09
nit: this comment is gratuitious, please remove
h
gone
2012/08/17 18:39:55
Done.
| |
798 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | |
799 SetUserAgentOverride(override)); | |
796 } | 800 } |
797 | 801 |
798 const std::string& WebContentsImpl::GetUserAgentOverride() const { | 802 const std::string& WebContentsImpl::GetUserAgentOverride() const { |
799 return renderer_preferences_.user_agent_override; | 803 return renderer_preferences_.user_agent_override; |
800 } | 804 } |
801 | 805 |
802 const string16& WebContentsImpl::GetTitle() const { | 806 const string16& WebContentsImpl::GetTitle() const { |
803 // Transient entries take precedence. They are used for interstitial pages | 807 // Transient entries take precedence. They are used for interstitial pages |
804 // that are shown on top of existing pages. | 808 // that are shown on top of existing pages. |
805 NavigationEntry* entry = controller_.GetTransientEntry(); | 809 NavigationEntry* entry = controller_.GetTransientEntry(); |
(...skipping 2378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3184 old_browser_plugin_host()->embedder_render_process_host(); | 3188 old_browser_plugin_host()->embedder_render_process_host(); |
3185 *embedder_container_id = old_browser_plugin_host()->instance_id(); | 3189 *embedder_container_id = old_browser_plugin_host()->instance_id(); |
3186 int embedder_process_id = | 3190 int embedder_process_id = |
3187 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3191 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
3188 if (embedder_process_id != -1) { | 3192 if (embedder_process_id != -1) { |
3189 *embedder_channel_name = | 3193 *embedder_channel_name = |
3190 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3194 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
3191 embedder_process_id); | 3195 embedder_process_id); |
3192 } | 3196 } |
3193 } | 3197 } |
OLD | NEW |