Define scale limits for "ubrowser --mobile"
authorGrzegorz Czajkowski <g.czajkowski@samsung.com>
Tue, 24 Nov 2015 13:05:12 +0000 (14:05 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
OS_TIZEN_MOBILE and ANDROID builds set minimum scale to 0.25
to make auto fitting work [1]. The same should have been done
for ubrowser --mobile.

[1] http://165.213.202.130/gerrit/#/c/95666/

Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=14929

Reviewed by: a1.gomes, djmix.kim

Change-Id: I0f0da8797c5508bb5b3f8f1fa2ce34f23193d39d
Signed-off-by: Grzegorz Czajkowski <g.czajkowski@samsung.com>
tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc

index bfdefa41f2e4eeff6429b199b3d63448b4238e8d..5959995d6349d3ec996c474fef6867c7bccc1dd2 100644 (file)
@@ -61,6 +61,11 @@ using autofill::PasswordGenerationAgent;
 // better empirical results.
 static const float maximum_legible_scale = 2.0f;
 
+// Scale limits which are defined for mobile builds in
+// web_preferences.cc.
+static const float minimum_page_scale_for_mobile = 0.25f;
+static const float maximum_page_scale_for_mobile = 5.f;
+
 class WrtUrlParseImpl : public content::WrtUrlParseBase {
  public:
   WrtUrlParseImpl(WrtWidget* wrt_widget) : wrt_widget_(wrt_widget) {}
@@ -280,5 +285,8 @@ void ContentRendererClientEfl::ApplyCustomSettings(blink::WebView* webview) {
     // setAutoZoomFocusedNodeToLegibleScale to it.
     settings->setViewportMetaEnabled(true);
     settings->setAutoZoomFocusedNodeToLegibleScale(true);
+
+    webview->setDefaultPageScaleLimits(minimum_page_scale_for_mobile,
+                                       maximum_page_scale_for_mobile);
   }
 }