diff options
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webpreferences.cc | 2 | ||||
-rw-r--r-- | webkit/glue/webpreferences.h | 4 | ||||
-rw-r--r-- | webkit/glue/webview.h | 4 | ||||
-rw-r--r-- | webkit/glue/webview_impl.cc | 10 | ||||
-rw-r--r-- | webkit/glue/webview_impl.h | 16 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 2 |
7 files changed, 22 insertions, 18 deletions
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc index 785bdbf..9b822fa 100644 --- a/webkit/glue/webpreferences.cc +++ b/webkit/glue/webpreferences.cc @@ -27,7 +27,7 @@ void WebPreferences::Apply(WebView* web_view) const { settings->setDefaultFixedFontSize(default_fixed_font_size); settings->setMinimumFontSize(minimum_font_size); settings->setMinimumLogicalFontSize(minimum_logical_font_size); - settings->setDefaultTextEncodingName(WideToUTF16Hack(default_encoding)); + settings->setDefaultTextEncodingName(ASCIIToUTF16(default_encoding)); settings->setJavaScriptEnabled(javascript_enabled); settings->setWebSecurityEnabled(web_security_enabled); settings->setJavaScriptCanOpenWindowsAutomatically( diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index f0ab0bb..8c9a649 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -27,7 +27,7 @@ struct WebPreferences { int default_fixed_font_size; int minimum_font_size; int minimum_logical_font_size; - std::wstring default_encoding; + std::string default_encoding; bool javascript_enabled; bool web_security_enabled; bool javascript_can_open_windows_automatically; @@ -68,7 +68,7 @@ struct WebPreferences { default_fixed_font_size(13), minimum_font_size(1), minimum_logical_font_size(6), - default_encoding(L"ISO-8859-1"), + default_encoding("ISO-8859-1"), javascript_enabled(true), web_security_enabled(true), javascript_can_open_windows_automatically(true), diff --git a/webkit/glue/webview.h b/webkit/glue/webview.h index 7346c1c..0b55232 100644 --- a/webkit/glue/webview.h +++ b/webkit/glue/webview.h @@ -156,10 +156,10 @@ class WebView : public WebKit::WebWidget { // Set the encoding of the current main frame. The value comes from // the encoding menu. WebKit uses the function named // SetCustomTextEncodingName to do override encoding job. - virtual void SetPageEncoding(const std::wstring& encoding_name) = 0; + virtual void SetPageEncoding(const std::string& encoding_name) = 0; // Return the canonical encoding name of current main webframe in webview. - virtual std::wstring GetMainFrameEncodingName() = 0; + virtual std::string GetMainFrameEncodingName() = 0; // Change the text zoom level. It will make the zoom level 20% larger or // smaller. If text_only is set, the text size will be changed. When unset, diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index bbf7d29..2103ba5 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -1403,25 +1403,25 @@ void WebViewImpl::SetInspectorSettings(const std::wstring& settings) { // Set the encoding of the current main frame to the one selected by // a user in the encoding menu. -void WebViewImpl::SetPageEncoding(const std::wstring& encoding_name) { +void WebViewImpl::SetPageEncoding(const std::string& encoding_name) { if (!page_.get()) return; if (!encoding_name.empty()) { // only change override encoding, don't change default encoding // TODO(brettw) use std::string for encoding names. - String new_encoding_name(webkit_glue::StdWStringToString(encoding_name)); + String new_encoding_name(webkit_glue::StdStringToString(encoding_name)); page_->mainFrame()->loader()->reloadWithOverrideEncoding(new_encoding_name); } } // Return the canonical encoding name of current main webframe in webview. -std::wstring WebViewImpl::GetMainFrameEncodingName() { +std::string WebViewImpl::GetMainFrameEncodingName() { if (!page_.get()) - return std::wstring(); + return std::string(); String encoding_name = page_->mainFrame()->loader()->encoding(); - return webkit_glue::StringToStdWString(encoding_name); + return webkit_glue::StringToStdString(encoding_name); } void WebViewImpl::ZoomIn(bool text_only) { diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index 132f7b2..ef181f0 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -6,6 +6,8 @@ #define WEBKIT_GLUE_WEBVIEW_IMPL_H_ #include <set> +#include <string> +#include <vector> #include "Page.h" @@ -85,8 +87,10 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { virtual WebKit::WebFrame* GetFocusedFrame(); virtual void SetFocusedFrame(WebKit::WebFrame* frame); virtual WebKit::WebFrame* GetFrameWithName(const WebKit::WebString& name); - virtual WebKit::WebFrame* GetPreviousFrameBefore(WebKit::WebFrame* frame, bool wrap); - virtual WebKit::WebFrame* GetNextFrameAfter(WebKit::WebFrame* frame, bool wrap); + virtual WebKit::WebFrame* GetPreviousFrameBefore(WebKit::WebFrame* frame, + bool wrap); + virtual WebKit::WebFrame* GetNextFrameAfter(WebKit::WebFrame* frame, + bool wrap); virtual void ClearFocusedNode(); virtual void StopLoading(); virtual void SetBackForwardListSize(int size); @@ -95,8 +99,8 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { virtual WebKit::WebSettings* GetSettings(); virtual const std::wstring& GetInspectorSettings() const; virtual void SetInspectorSettings(const std::wstring& settings); - virtual void SetPageEncoding(const std::wstring& encoding_name); - virtual std::wstring GetMainFrameEncodingName(); + virtual void SetPageEncoding(const std::string& encoding_name); + virtual std::string GetMainFrameEncodingName(); virtual void ZoomIn(bool text_only); virtual void ZoomOut(bool text_only); virtual void ResetZoom(); @@ -386,11 +390,11 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { // HACK: current_input_event is for ChromeClientImpl::show(), until we can fix // WebKit to pass enough information up into ChromeClient::show() so we can // decide if the window.open event was caused by a middle-mouse click -public: + public: static const WebKit::WebInputEvent* current_input_event() { return g_current_input_event; } -private: + private: static const WebKit::WebInputEvent* g_current_input_event; DISALLOW_COPY_AND_ASSIGN(WebViewImpl); diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index be19c95..fbfda9f 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -894,7 +894,7 @@ void LayoutTestController::overridePreference( else if (key == "WebKitMinimumLogicalFontSize") preferences->minimum_logical_font_size = CppVariantToInt32(value); else if (key == "WebKitDefaultTextEncodingName") - preferences->default_encoding = CppVariantToWstring(value); + preferences->default_encoding = value.ToString(); else if (key == "WebKitJavaScriptEnabled") preferences->javascript_enabled = CppVariantToBool(value); else if (key == "WebKitWebSecurityEnabled") diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 317a746..3ebb1bc 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -402,7 +402,7 @@ void TestShell::ResetWebPreferences() { web_prefs_->fixed_font_family = L"Courier"; web_prefs_->sans_serif_font_family = L"Helvetica"; - web_prefs_->default_encoding = L"ISO-8859-1"; + web_prefs_->default_encoding = "ISO-8859-1"; web_prefs_->default_font_size = 16; web_prefs_->default_fixed_font_size = 13; web_prefs_->minimum_font_size = 1; |