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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10170016: Add info about user agent overrides to WebContents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Forgot to initialize bool in constructor; win_rel caught it Created 8 years, 7 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 700
701 content::WebUI* WebContentsImpl::GetWebUI() const { 701 content::WebUI* WebContentsImpl::GetWebUI() const {
702 return render_manager_.web_ui() ? render_manager_.web_ui() 702 return render_manager_.web_ui() ? render_manager_.web_ui()
703 : render_manager_.pending_web_ui(); 703 : render_manager_.pending_web_ui();
704 } 704 }
705 705
706 content::WebUI* WebContentsImpl::GetCommittedWebUI() const { 706 content::WebUI* WebContentsImpl::GetCommittedWebUI() const {
707 return render_manager_.web_ui(); 707 return render_manager_.web_ui();
708 } 708 }
709 709
710 void WebContentsImpl::SetUserAgentOverride(const std::string& override) {
711 user_agent_override_ = override;
712 }
713
714 const std::string& WebContentsImpl::GetUserAgentOverride() const {
715 return user_agent_override_;
716 }
717
710 const string16& WebContentsImpl::GetTitle() const { 718 const string16& WebContentsImpl::GetTitle() const {
711 // Transient entries take precedence. They are used for interstitial pages 719 // Transient entries take precedence. They are used for interstitial pages
712 // that are shown on top of existing pages. 720 // that are shown on top of existing pages.
713 NavigationEntry* entry = controller_.GetTransientEntry(); 721 NavigationEntry* entry = controller_.GetTransientEntry();
714 std::string accept_languages = 722 std::string accept_languages =
715 content::GetContentClient()->browser()->GetAcceptLangs( 723 content::GetContentClient()->browser()->GetAcceptLangs(
716 GetBrowserContext()); 724 GetBrowserContext());
717 if (entry) { 725 if (entry) {
718 return entry->GetTitleForDisplay(accept_languages); 726 return entry->GetTitleForDisplay(accept_languages);
719 } 727 }
(...skipping 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after
2729 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2737 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2730 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 2738 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
2731 // Can be NULL during tests. 2739 // Can be NULL during tests.
2732 if (rwh_view) 2740 if (rwh_view)
2733 rwh_view->SetSize(GetView()->GetContainerSize()); 2741 rwh_view->SetSize(GetView()->GetContainerSize());
2734 } 2742 }
2735 2743
2736 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { 2744 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() {
2737 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); 2745 return static_cast<RenderViewHostImpl*>(GetRenderViewHost());
2738 } 2746 }
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/navigation_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698