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

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: Added SessionService saving Created 8 years, 8 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 682
683 content::WebUI* WebContentsImpl::GetWebUI() const { 683 content::WebUI* WebContentsImpl::GetWebUI() const {
684 return render_manager_.web_ui() ? render_manager_.web_ui() 684 return render_manager_.web_ui() ? render_manager_.web_ui()
685 : render_manager_.pending_web_ui(); 685 : render_manager_.pending_web_ui();
686 } 686 }
687 687
688 content::WebUI* WebContentsImpl::GetCommittedWebUI() const { 688 content::WebUI* WebContentsImpl::GetCommittedWebUI() const {
689 return render_manager_.web_ui(); 689 return render_manager_.web_ui();
690 } 690 }
691 691
692 void WebContentsImpl::SetUserAgentOverride(const std::string& override) {
693 user_agent_override_ = override;
694 }
695
696 const std::string& WebContentsImpl::GetUserAgentOverride() const {
697 return user_agent_override_;
698 }
699
692 const string16& WebContentsImpl::GetTitle() const { 700 const string16& WebContentsImpl::GetTitle() const {
693 // Transient entries take precedence. They are used for interstitial pages 701 // Transient entries take precedence. They are used for interstitial pages
694 // that are shown on top of existing pages. 702 // that are shown on top of existing pages.
695 NavigationEntry* entry = controller_.GetTransientEntry(); 703 NavigationEntry* entry = controller_.GetTransientEntry();
696 std::string accept_languages = 704 std::string accept_languages =
697 content::GetContentClient()->browser()->GetAcceptLangs( 705 content::GetContentClient()->browser()->GetAcceptLangs(
698 GetBrowserContext()); 706 GetBrowserContext());
699 if (entry) { 707 if (entry) {
700 return entry->GetTitleForDisplay(accept_languages); 708 return entry->GetTitleForDisplay(accept_languages);
701 } 709 }
(...skipping 1931 matching lines...) Expand 10 before | Expand all | Expand 10 after
2633 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2641 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2634 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 2642 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
2635 // Can be NULL during tests. 2643 // Can be NULL during tests.
2636 if (rwh_view) 2644 if (rwh_view)
2637 rwh_view->SetSize(GetView()->GetContainerSize()); 2645 rwh_view->SetSize(GetView()->GetContainerSize());
2638 } 2646 }
2639 2647
2640 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { 2648 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() {
2641 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); 2649 return static_cast<RenderViewHostImpl*>(GetRenderViewHost());
2642 } 2650 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698