* @param orientation the new orientation of the device. (degree)
*
* orientation will be 0 degrees when the device is oriented to natural position,
- * 90 degrees when it's left side is at the top,
- * -90 degrees when it's right side is at the top,
+ * -90 degrees when it's left side is at the top,
+ * 90 degrees when it's right side is at the top,
* 180 degrees when it is upside down.
*/
EAPI void ewk_view_orientation_send(Evas_Object *o, int orientation);
, m_prepareKeyDownEvent(false)
, m_recalcFilterEvent(false)
#endif
+#if ENABLE(TIZEN_ORIENTATION_EVENTS)
+ , m_newOrientation(-1)
+#endif
{
ASSERT(m_pageID);
// FIXME: This is a non-ideal location for this Setting and
attr.initialScale = ViewportArguments::ValueAuto;
#endif
+#if ENABLE(TIZEN_ORIENTATION_EVENTS)
+ if (m_mainFrame->coreFrame() && m_newOrientation != -1) {
+ m_mainFrame->coreFrame()->sendOrientationChangeEvent(m_newOrientation);
+ for (WebCore::Frame* child = m_mainFrame->coreFrame()->tree()->firstChild(); child; child = child->tree()->nextSibling())
+ child->sendOrientationChangeEvent(m_newOrientation);
+ m_newOrientation = -1;
+ }
+#endif
+
setResizesToContentsUsingLayoutSize(IntSize(static_cast<int>(attr.layoutSize.width()), static_cast<int>(attr.layoutSize.height())));
#if ENABLE(TIZEN_VIEWPORT_META_TAG)
if (!frame || frame->orientation() == newOrientation)
return;
+ // If it's rotated 90 or -90 degrees,
+ // orientation change event will be fired on WebPage::sendViewportAttributesChanged
+ if (fabs(frame->orientation() - newOrientation) != 180) {
+ m_newOrientation = newOrientation;
+ return;
+ }
+
+ // If it's rotated 180 degrees, ewk_view will not be resized
+ // So, fire orientation change event here
frame->sendOrientationChangeEvent(newOrientation);
for (WebCore::Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
child->sendOrientationChangeEvent(newOrientation);