diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-12 23:08:30 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-12 23:08:30 +0000 |
commit | e38f40150dac6e0af08e3cdcfb1e502a2223c87c (patch) | |
tree | 3b31c4c506ac390d712921ae35acad89f7afd5d7 /chrome/browser/web_contents.cc | |
parent | 5baa03fdfe3a13d4102a819fb3e653f1559b5259 (diff) | |
download | chromium_src-e38f40150dac6e0af08e3cdcfb1e502a2223c87c.zip chromium_src-e38f40150dac6e0af08e3cdcfb1e502a2223c87c.tar.gz chromium_src-e38f40150dac6e0af08e3cdcfb1e502a2223c87c.tar.bz2 |
Revert the change that fixed the encoding when viewing source in subframes.
This makes view source for some pages (for example Google Reader) not work
properly. I speculate that telling WebKit to change the encoding (which causes
a reload) right after starting the real load makes it confused.
Review URL: http://codereview.chromium.org/3022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2143 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_contents.cc')
-rw-r--r-- | chrome/browser/web_contents.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc index 0893681..fd061b3 100644 --- a/chrome/browser/web_contents.cc +++ b/chrome/browser/web_contents.cc @@ -711,7 +711,7 @@ void WebContents::AlterTextSize(text_zoom::TextSize size) { // TODO(creis): should this be propagated to other and future RVHs? } -void WebContents::SetPageEncoding(const std::string& encoding_name) { +void WebContents::SetPageEncoding(const std::wstring& encoding_name) { render_view_host()->SetPageEncoding(encoding_name); // TODO(creis): should this be propagated to other and future RVHs? } @@ -1609,7 +1609,7 @@ void WebContents::UpdateTitle(RenderViewHost* rvh, void WebContents::UpdateEncoding(RenderViewHost* render_view_host, - const std::string& encoding_name) { + const std::wstring& encoding_name) { SetEncoding(encoding_name); } @@ -1644,15 +1644,6 @@ void WebContents::DidStartLoading(RenderViewHost* rvh, int32 page_id) { if (plugin_installer_ != NULL) plugin_installer_->OnStartLoading(); SetIsLoading(true, NULL); - - // Overrides the page's encoding if we need to open this page with specified - // encoding. - if (!override_encoding_.empty()) { - SetPageEncoding(override_encoding_); - // Once we override the new encoding, we need to clear the encoding value - // for avoiding overriding it again. - override_encoding_.clear(); - } } void WebContents::DidStopLoading(RenderViewHost* rvh, int32 page_id) { @@ -2046,9 +2037,9 @@ WebPreferences WebContents::GetWebkitPrefs() { // webkit/glue/webpreferences.h for more details. // Make sure we will set the default_encoding with canonical encoding name. - web_prefs.default_encoding = UTF8ToWide( + web_prefs.default_encoding = CharacterEncoding::GetCanonicalEncodingNameByAliasName( - WideToUTF8(web_prefs.default_encoding))); + web_prefs.default_encoding); if (web_prefs.default_encoding.empty()) { prefs->ClearPref(prefs::kDefaultCharset); web_prefs.default_encoding = prefs->GetString( |