Added the initial value for ewk orientation
authorHoseon LEE <hoseon46.lee@samsung.com>
Mon, 25 Feb 2013 05:03:38 +0000 (14:03 +0900)
committerHoseon LEE <hoseon46.lee@samsung.com>
Tue, 26 Feb 2013 10:36:36 +0000 (19:36 +0900)
[Issue#] N/A
[Problem] The orientation value of ewk is not matched it of wrt
[Cause] The initial step is none
[Solution] Added the initial value for ewk orientation
[SCMRequest] N/A

Change-Id: I160df80b4ed2c0e8b6ae2b66589a33983872f9a5

src/view/webkit/view_logic_scheme_support.cpp
src/wrt-client/wrt-client.cpp

index 3cef451..74f79d8 100644 (file)
@@ -40,6 +40,9 @@ char const * const TIZEN_CHANGE_USERAGNET = "tizen://changeUA";
 const int ORIENTATION_LANDSCAPE_ANGLE = 270;
 const int ORIENTATION_PORTAIT_ANGLE = 0;
 
+const int W3C_SCREEN_ORI_PORTRAIT_PRIMARY = 0;
+const int W3C_SCREEN_ORI_LANDSCAPE_PRIMARY = 90;
+
 static Eina_Bool exitAppIdlerCallback(void* /*data*/)
 {
     // webapp termination
@@ -86,6 +89,7 @@ bool SchemeSupport::HandleTizenScheme(const char* uri,
     {
         LogInfo("Tizen scheme: " << uri << " orientation landscape");
         elm_win_rotation_with_resize_set(window, ORIENTATION_LANDSCAPE_ANGLE);
+        ewk_view_orientation_send(wkView, W3C_SCREEN_ORI_LANDSCAPE_PRIMARY);
         return true;
     } else if (strncmp(uri,
                        TIZEN_ORIENTATION_PORTAIT,
@@ -93,6 +97,7 @@ bool SchemeSupport::HandleTizenScheme(const char* uri,
     {
         LogInfo("Tizen scheme: " << uri << " orientation portait");
         elm_win_rotation_with_resize_set(window, ORIENTATION_PORTAIT_ANGLE);
+        ewk_view_orientation_send(wkView, W3C_SCREEN_ORI_PORTRAIT_PRIMARY);
         return true;
     } else if (strncmp(uri,
                        TIZEN_ORIENTATION_RESET,
@@ -100,6 +105,7 @@ bool SchemeSupport::HandleTizenScheme(const char* uri,
     {
         LogInfo("Tizen scheme: " << uri << " reset");
         elm_win_rotation_with_resize_set(window, ORIENTATION_PORTAIT_ANGLE);
+        ewk_view_orientation_send(wkView, W3C_SCREEN_ORI_PORTRAIT_PRIMARY);
         return true;
     } else if (strncmp(uri,
                        TIZEN_CHANGE_USERAGNET,
index bfd4bb7..1e88b79 100644 (file)
@@ -617,10 +617,13 @@ void WrtClient::connectElmCallback()
         WidgetSettingScreenLock rotationValue = settings.getRotationValue();
         if (rotationValue == Screen_Portrait) {
             elm_win_rotation_with_resize_set(m_windowData->m_win, 0);
+            ewk_view_orientation_send(m_widget->GetCurrentWebview(), 0);
         } else if (rotationValue == Screen_Landscape) {
             elm_win_rotation_with_resize_set(m_windowData->m_win, 270);
+            ewk_view_orientation_send(m_widget->GetCurrentWebview(), 90);
         } else {
             elm_win_rotation_with_resize_set(m_windowData->m_win, 0);
+            ewk_view_orientation_send(m_widget->GetCurrentWebview(), 0);
         }
     }
 }