summaryrefslogtreecommitdiffstats
path: root/chrome/browser/render_view_context_menu_controller.cc
diff options
context:
space:
mode:
authorjnd@google.com <jnd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-18 21:24:29 +0000
committerjnd@google.com <jnd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-18 21:24:29 +0000
commit72c94f309664498277eee70eeccc05b44f0f255a (patch)
tree65d2fedf4b6907c4971dae0e8526d3c20efe9264 /chrome/browser/render_view_context_menu_controller.cc
parentea8c4104164fcb225003bf074d3d4693929e00da (diff)
downloadchromium_src-72c94f309664498277eee70eeccc05b44f0f255a.zip
chromium_src-72c94f309664498277eee70eeccc05b44f0f255a.tar.gz
chromium_src-72c94f309664498277eee70eeccc05b44f0f255a.tar.bz2
The CL is consist of CLs(1624,1580) for bug:1281734 which are reviewed and LG by brett. I just merge them to single one for passing compilation.
The CL is to fix bug http://b/issue?id=1281734. FireFox uses encoding used by the original webpage to decode the source of the webpage, Chrome does not. We need to add a new parameter which carries the override encoding when opening a view-source URL for viewing its source. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@997 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_view_context_menu_controller.cc')
-rw-r--r--chrome/browser/render_view_context_menu_controller.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/render_view_context_menu_controller.cc b/chrome/browser/render_view_context_menu_controller.cc
index 790f641..c4ec6ad 100644
--- a/chrome/browser/render_view_context_menu_controller.cc
+++ b/chrome/browser/render_view_context_menu_controller.cc
@@ -67,6 +67,15 @@ RenderViewContextMenuController::~RenderViewContextMenuController() {
///////////////////////////////////////////////////////////////////////////////
// Controller methods
+void RenderViewContextMenuController::OpenURLWithOverrideEncoding(
+ const GURL& url,
+ WindowOpenDisposition disposition,
+ PageTransition::Type transition,
+ const std::wstring& override_encoding) {
+ source_web_contents_->OpenURLWithOverrideEncoding(url, disposition,
+ transition, override_encoding);
+}
+
void RenderViewContextMenuController::OpenURL(
const GURL& url,
WindowOpenDisposition disposition,
@@ -298,8 +307,10 @@ void RenderViewContextMenuController::ExecuteCommand(int id) {
break;
case IDS_CONTENT_CONTEXT_VIEWPAGESOURCE:
- OpenURL(GURL("view-source:" + params_.page_url.spec()),
- NEW_FOREGROUND_TAB, PageTransition::GENERATED);
+ OpenURLWithOverrideEncoding(
+ GURL("view-source:" + params_.page_url.spec()),
+ NEW_FOREGROUND_TAB, PageTransition::GENERATED,
+ source_web_contents_->GetEncoding());
break;
case IDS_CONTENT_CONTEXT_INSPECTELEMENT:
@@ -334,8 +345,10 @@ void RenderViewContextMenuController::ExecuteCommand(int id) {
break;
case IDS_CONTENT_CONTEXT_VIEWFRAMESOURCE:
- OpenURL(GURL("view-source:" + params_.frame_url.spec()),
- NEW_FOREGROUND_TAB, PageTransition::GENERATED);
+ OpenURLWithOverrideEncoding(
+ GURL("view-source:" + params_.frame_url.spec()),
+ NEW_FOREGROUND_TAB, PageTransition::GENERATED,
+ params_.frame_encoding);
break;
case IDS_CONTENT_CONTEXT_VIEWFRAMEINFO: