[Tizen][M34-Merge] Implement Ewk_Settings: cache builder & default text encoding...
authorzhishun.zhou <zhishun.zhou@samsung.com>
Mon, 20 Oct 2014 08:17:40 +0000 (16:17 +0800)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
This patch implement two Ewk_Settings: set cache builder enable
and set default text encoding name.
This is code migration from m34 beta to DEV,
Original patch info:
http://suprem.sec.samsung.net/gerrit/#/c/6533/3 and
http://165.213.202.130:8080/#/c/68824/

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=7799
Reviewed by: Antonio Gomes, SeungSeop Park

Change-Id: I4c344a8ee508804939e9219f736ec5e4a901a703
Signed-off-by: zhishun.zhou <zhishun.zhou@samsung.com>
tizen_src/ewk/efl_integration/public/ewk_settings.cc
tizen_src/impl/API/ewk_settings_private.cc
tizen_src/impl/API/ewk_settings_private.h

index 7d452a9..55511de 100644 (file)
@@ -603,9 +603,9 @@ Eina_Bool ewk_settings_detect_contents_automatically_get(const Ewk_Settings* set
 
 void ewk_settings_cache_builder_enabled_set(Ewk_Settings *settings, Eina_Bool enabled)
 {
-#if defined(OS_TIZEN_TV) && !defined(EWK_BRINGUP)
+#if defined(OS_TIZEN_TV)
   EINA_SAFETY_ON_NULL_RETURN(settings);
-  settings->setCacheBuilder(enabled);
+  settings->setCacheBuilderEnabled(enabled);
 #else
   LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
 #endif
@@ -632,15 +632,10 @@ const char* ewk_settings_default_text_encoding_name_get(Ewk_Settings* settings)
 
 Eina_Bool ewk_settings_default_text_encoding_name_set(Ewk_Settings* settings, const char* encoding)
 {
-#if defined(OS_TIZEN_TV) && !defined(EWK_BRINGUP)
   EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
   EINA_SAFETY_ON_NULL_RETURN_VAL(encoding, false);
   settings->setDefaultTextEncoding(encoding);
   return true;
-#else
-  LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
-  return false;
-#endif
 }
 
 #if defined(OS_TIZEN_TV)
index 209367f..c891fd8 100644 (file)
@@ -17,3 +17,8 @@ void Ewk_Settings::setCurrentLegacyFontSizeMode(tizen_webview::Legacy_Font_Size_
     m_preferences.current_legacy_font_size_mode = static_cast<content::LegacyFontSizeMode>(mode);
 #endif
 }
+
+void Ewk_Settings::setDefaultTextEncoding(const char* encoding) {
+  if (encoding)
+    m_preferences.default_encoding = encoding;
+}
index 15eca8e..7b2380d 100644 (file)
@@ -34,9 +34,14 @@ class Ewk_Settings {
         , m_autoFitting(false)
         , m_linkEffectEnabled(true)
         , m_evas_object(evas_object)
+#if defined(OS_TIZEN_TV)
+        , m_cacheBuilderEnabled(false)
+#endif
     { }
 
-    const char* defaultTextEncoding() const { return m_defaultTextEncoding; }
+    const char* defaultTextEncoding() const {
+        return m_preferences.default_encoding.c_str();
+    }
     void setDefaultTextEncoding(const char*);
     bool autofillPasswordForm() const { return m_autofillPasswordForm; }
     void setAutofillPasswordForm(bool enable) { m_autofillPasswordForm = enable; }
@@ -77,10 +82,12 @@ class Ewk_Settings {
     Evas_Object* getEvasObject() { return m_evas_object; }
     content::WebPreferences& getPreferences() { return m_preferences; }
     const content::WebPreferences& getPreferences() const { return m_preferences; }
+#if defined(OS_TIZEN_TV)
+    void setCacheBuilderEnabled(bool enable) { m_cacheBuilderEnabled = enable; }
+#endif
 
   private:
     content::WebPreferences m_preferences;
-    Eina_Stringshare* m_defaultTextEncoding;
     bool m_autofillPasswordForm;
     bool m_formCandidateData;
     bool m_autofillProfileForm;
@@ -99,6 +106,9 @@ class Ewk_Settings {
     bool m_linkEffectEnabled;
     bool m_detectContentsAutomatically;
     Evas_Object* m_evas_object;
+#if defined(OS_TIZEN_TV)
+    bool m_cacheBuilderEnabled;
+#endif
 };
 
 #endif // ewk_settings_private_h