summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc7
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc4
-rw-r--r--chrome/browser/tab_contents/tab_contents.h10
-rw-r--r--chrome/browser/tab_contents/web_contents_unittest.cc2
4 files changed, 12 insertions, 11 deletions
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index 4f1a5aa..9a5d1a7 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -135,7 +135,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
web_prefs.minimum_logical_font_size =
prefs->GetInteger(prefs::kWebKitMinimumLogicalFontSize);
- web_prefs.default_encoding = prefs->GetString(prefs::kDefaultCharset);
+ web_prefs.default_encoding =
+ WideToASCII(prefs->GetString(prefs::kDefaultCharset));
web_prefs.javascript_can_open_windows_automatically =
prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically);
@@ -202,8 +203,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
web_prefs.default_encoding);
if (web_prefs.default_encoding.empty()) {
prefs->ClearPref(prefs::kDefaultCharset);
- web_prefs.default_encoding = prefs->GetString(
- prefs::kDefaultCharset);
+ web_prefs.default_encoding = WideToASCII(
+ prefs->GetString(prefs::kDefaultCharset));
}
DCHECK(!web_prefs.default_encoding.empty());
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index c76b733..29ccbc4 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2017,7 +2017,7 @@ void TabContents::UpdateTitle(RenderViewHost* rvh,
}
void TabContents::UpdateEncoding(RenderViewHost* render_view_host,
- const std::wstring& encoding) {
+ const std::string& encoding) {
set_encoding(encoding);
}
@@ -2505,7 +2505,7 @@ void TabContents::Observe(NotificationType type,
}
}
-void TabContents::set_encoding(const std::wstring& encoding) {
+void TabContents::set_encoding(const std::string& encoding) {
encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding);
}
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 51b8954..3f0546b 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -232,8 +232,8 @@ class TabContents : public PageNavigator,
bool is_starred() const { return is_starred_; }
- const std::wstring& encoding() const { return encoding_; }
- void set_encoding(const std::wstring& encoding);
+ const std::string& encoding() const { return encoding_; }
+ void set_encoding(const std::string& encoding);
// Internal state ------------------------------------------------------------
@@ -574,7 +574,7 @@ class TabContents : public PageNavigator,
// the opposite of this, by which 'browser' is notified of
// the encoding of the current tab from 'renderer' (determined by
// auto-detect, http header, meta, bom detection, etc).
- void override_encoding(const std::wstring& encoding) {
+ void override_encoding(const std::string& encoding) {
set_encoding(encoding);
render_view_host()->SetPageEncoding(encoding);
}
@@ -828,7 +828,7 @@ class TabContents : public PageNavigator,
int32 page_id,
const std::wstring& title);
virtual void UpdateEncoding(RenderViewHost* render_view_host,
- const std::wstring& encoding);
+ const std::string& encoding);
virtual void UpdateTargetURL(int32 page_id, const GURL& url);
virtual void UpdateThumbnail(const GURL& url,
const SkBitmap& bitmap,
@@ -1020,7 +1020,7 @@ class TabContents : public PageNavigator,
std::string contents_mime_type_;
// Character encoding. TODO(jungshik) : convert to std::string
- std::wstring encoding_;
+ std::string encoding_;
// Data for shelves and stuff ------------------------------------------------
diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc
index 47426c4..b5a8048 100644
--- a/chrome/browser/tab_contents/web_contents_unittest.cc
+++ b/chrome/browser/tab_contents/web_contents_unittest.cc
@@ -572,7 +572,7 @@ TEST_F(TabContentsTest, WebKitPrefs) {
WebPreferences webkit_prefs = contents()->TestGetWebkitPrefs();
// These values have been overridden by the profile preferences.
- EXPECT_EQ(L"UTF-8", webkit_prefs.default_encoding);
+ EXPECT_EQ("UTF-8", webkit_prefs.default_encoding);
EXPECT_EQ(20, webkit_prefs.default_font_size);
EXPECT_EQ(false, webkit_prefs.text_areas_are_resizable);
EXPECT_EQ(true, webkit_prefs.uses_universal_detector);