From: Pawel Sikorski
Date: Tue, 5 Feb 2013 15:55:26 +0000 (+0100)
Subject: Source code formating unification
X-Git-Tag: 2.1b_release~22^2~68
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9d7e75f27f6a3f6566621a18ef42d34b36f3014;p=platform%2Fframework%2Fweb%2Fwrt.git
Source code formating unification
[Issue#] N/A
[Problem] Source code was not formatted to any rules. In this situation
creating new patches or making review may become uncomfortable.
[Cause] No formatting rules/tool used.
[Solution] To make implementation and review process more comfortable, whole
wrt repository source code has been formatted with uncrustify tool. The
configuration of the tool is located in the repository (./uncrustify.cfg).
Command used (stored in uncrustify.sh):
uncrustify -c ./uncrustify.cfg --no-backup `find . -regex
"\(.*\.cpp\|.*\.h\|.*\.c\|.*\.cc\)" | grep -v "orm.h\|orm_generator.h"`
[Verification] Build the repository
Change-Id: Ic0c05e2c362ac2795f3a96c89f1ca2fae4f0d69f
---
diff --git a/src/api_new/core_module.cpp b/src/api_new/core_module.cpp
index ee8c350..62030b2 100644
--- a/src/api_new/core_module.cpp
+++ b/src/api_new/core_module.cpp
@@ -39,11 +39,9 @@
#include
-
IMPLEMENT_SINGLETON(WRT::CoreModule)
namespace { //Anonymous
-
const char * const bundlePath = "/usr/lib/wrt-wk2-bundles/libwrt-wk2-bundle.so";
std::string cutOffFileName(const std::string& path)
@@ -85,17 +83,16 @@ bool checkPaths()
if_ok &= (isDir(GetUserInstalledWidgetPath()));
if (!if_ok) {
LogError("Path <" << GetUserInstalledWidgetPath() <<
- "> does not exist.");
+ "> does not exist.");
}
return if_ok;
}
-}// namespace anonymous
+} // namespace anonymous
namespace WRT {
-
class CoreModuleImpl
{
-public:
+ public:
CoreModuleImpl() : m_initialized(false), m_ewkContext(NULL)
{
@@ -119,8 +116,7 @@ public:
}
Try
{
- if(!m_ewkContext)
- {
+ if (!m_ewkContext) {
// Needed settings for WKContext are located here
// create Ewk_Context
Ewk_Context* newEwkContext =
@@ -143,8 +139,9 @@ public:
Ewk_Cookie_Manager *ewkCookieManager;
ewkCookieManager =
ewk_context_cookie_manager_get(m_ewkContext);
- ewk_cookie_manager_accept_policy_set(ewkCookieManager,
- EWK_COOKIE_ACCEPT_POLICY_ALWAYS);
+ ewk_cookie_manager_accept_policy_set(
+ ewkCookieManager,
+ EWK_COOKIE_ACCEPT_POLICY_ALWAYS);
ADD_PROFILING_POINT("WebProcess fork", "stop");
ADD_PROFILING_POINT("attach databases", "start");
@@ -158,7 +155,7 @@ public:
/* TODO:
* Do deinitialization: check on which step exception occured
* and deinitialize only initialized parts.
- */
+ */
return false;
}
m_initialized = true;
@@ -168,8 +165,7 @@ public:
bool Init(Ewk_Context* ewk_context)
{
- if(ewk_context)
- {
+ if (ewk_context) {
m_ewkContext = ewk_context;
}
@@ -189,7 +185,7 @@ public:
}
RunnableWidgetObjectPtr getRunnableWidgetObject(
- const std::string& tizenId)
+ const std::string& tizenId)
{
PluginModuleSupport::init(m_ewkContext, tizenId);
@@ -243,18 +239,16 @@ public:
return WrtDB::GlobalDAOReadOnly::GetDeveloperMode();
}
-private:
+ private:
bool m_initialized;
Ewk_Context* m_ewkContext;
};
CoreModule::CoreModule() : m_impl(new CoreModuleImpl())
-{
-}
+{}
CoreModule::~CoreModule()
-{
-}
+{}
bool CoreModule::Init()
{
@@ -272,7 +266,7 @@ void CoreModule::Terminate()
}
RunnableWidgetObjectPtr CoreModule::getRunnableWidgetObject(
- const std::string& tizenId)
+ const std::string& tizenId)
{
return m_impl->getRunnableWidgetObject(tizenId);
}
@@ -291,5 +285,4 @@ bool CoreModule::developerMode()
{
return m_impl->developerMode();
}
-
} /* namespace WRT */
diff --git a/src/api_new/core_module.h b/src/api_new/core_module.h
index f436012..93d5a47 100644
--- a/src/api_new/core_module.h
+++ b/src/api_new/core_module.h
@@ -32,7 +32,6 @@
#include
namespace WRT {
-
class CoreModuleImpl; // forward declaration
class CoreModule
@@ -69,7 +68,7 @@ class CoreModule
* @return NULL on fail
*/
RunnableWidgetObjectPtr getRunnableWidgetObject(
- const std::string& tizenId);
+ const std::string& tizenId);
/**
* Gets from database global property of homeNetworkAccess
* @return homeNetworkAccess value
@@ -95,6 +94,5 @@ class CoreModule
};
typedef DPL::Singleton CoreModuleSingleton;
-
} /* namespace WRT */
#endif /* CORE_MODULE_H_ */
diff --git a/src/api_new/i_runnable_widget_object.h b/src/api_new/i_runnable_widget_object.h
index a032f26..dca9c3a 100644
--- a/src/api_new/i_runnable_widget_object.h
+++ b/src/api_new/i_runnable_widget_object.h
@@ -32,13 +32,13 @@
#include
namespace WRT {
-
typedef DPL::FastDelegate0 ProgressFinishCB;
typedef DPL::FastDelegate1 LoadStartCB;
typedef DPL::FastDelegate1 LoadFinishCB;
typedef DPL::FastDelegate0 WebCrashCB;
typedef DPL::FastDelegate2 WindowCreateBeforeCB;
-typedef DPL::FastDelegate2 WindowCreateAfterCB;
+typedef DPL::FastDelegate2 WindowCreateAfterCB;
typedef DPL::FastDelegate1 WindowCloseCB;
typedef DPL::FastDelegate0 WebkitExitCB;
typedef DPL::FastDelegate1 ResumeCB;
@@ -100,8 +100,9 @@ typedef std::shared_ptr WidgetModelPtr;
* \-------------(HIDDEN)
*
*/
-class IRunnableWidgetObject {
-public:
+class IRunnableWidgetObject
+{
+ public:
// IRunnableWidgetObject base exception
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
@@ -168,12 +169,10 @@ public:
*/
virtual void FireJavascriptEvent(int event, void* data) = 0;
-
- virtual ~IRunnableWidgetObject() {};
+ virtual ~IRunnableWidgetObject() {}
};
typedef std::shared_ptr RunnableWidgetObjectPtr;
-
}
#endif /* RUNNABLE_WIDGET_OBJECT_INTERFACE_H_ */
diff --git a/src/api_new/runnable_widget_object.cpp b/src/api_new/runnable_widget_object.cpp
index 61d96a2..6e37f4b 100644
--- a/src/api_new/runnable_widget_object.cpp
+++ b/src/api_new/runnable_widget_object.cpp
@@ -39,18 +39,18 @@ const std::string ALREADY_RUNNING = _("IDS_BR_POP_ALREADY_RUNNING");
const std::string INVALID_LOCALE = _("IDS_IM_POP_INVALID_WIDGET_LOCALE");
const std::string STILL_AUTHORIZING = _("IDS_IM_POP_AUTHORIZING_ING_ATNT");
const unsigned int UID_ROOT = 0;
-
} // namespace anonymous
namespace WRT {
-
-RunnableWidgetObject::RunnableWidgetObject(WidgetModelPtr &model, Ewk_Context* context) :
- m_widgetModel(model),
- m_view(ViewModule::createView()),
- m_ewkContext(context)
+RunnableWidgetObject::RunnableWidgetObject(WidgetModelPtr &model,
+ Ewk_Context* context) :
+ m_widgetModel(model),
+ m_view(ViewModule::createView()),
+ m_ewkContext(context)
{
//set initial state of runnable object
- m_guardstate = std::shared_ptr(new State::InitialState(*this));
+ m_guardstate = std::shared_ptr(
+ new State::InitialState(*this));
// If current uid is 'root', change privilege to apps
if (UID_ROOT == getuid()) {
// Set privilege by tizen id
@@ -79,11 +79,10 @@ bool RunnableWidgetObject::CheckBeforeLaunch()
wrt_ocsp_widget_verification_status_t response;
if (m_widgetModel->Type.Get().appType == WrtDB::APP_TYPE_WAC20) {
-
wrt_ocsp_initialize();
- wrt_ocsp_verify_widget(WrtDB::WidgetDAOReadOnly::getHandle(m_widgetModel->TizenId), &response);
+ wrt_ocsp_verify_widget(WrtDB::WidgetDAOReadOnly::getHandle(
+ m_widgetModel->TizenId), &response);
wrt_ocsp_shutdown();
-
} else {
response = WRT_OCSP_WIDGET_VERIFICATION_STATUS_GOOD;
}
@@ -105,14 +104,13 @@ bool RunnableWidgetObject::CheckBeforeLaunch()
}
bool RunnableWidgetObject::PrepareView(const std::string &startUrl,
- Evas_Object *window)
+ Evas_Object *window)
{
State::StateChange change = m_guardstate->allowPrepareView();
Assert(window);
ADD_PROFILING_POINT("view_logic_init", "start");
- if(!m_view->createWebView(m_ewkContext, window))
- {
+ if (!m_view->createWebView(m_ewkContext, window)) {
return false;
}
m_view->initialize();
@@ -184,7 +182,8 @@ Evas_Object* RunnableWidgetObject::GetCurrentWebview()
return cww;
}
-void RunnableWidgetObject::SetUserDelegates(const UserDelegatesPtr& cbs) {
+void RunnableWidgetObject::SetUserDelegates(const UserDelegatesPtr& cbs)
+{
State::StateChange change = m_guardstate->allowSetUserDelegates();
m_view->setUserCallbacks(cbs);
change.commit();
@@ -206,7 +205,8 @@ void RunnableWidgetObject::FireJavascriptEvent(int event, void* data)
change.commit();
}
-void RunnableWidgetObject::setNewState(std::shared_ptr sptr)
+void RunnableWidgetObject::setNewState(
+ std::shared_ptr sptr)
{
LogInfo("RunnableWidgetObject changes state to: " << sptr->toString());
m_guardstate = sptr;
@@ -217,5 +217,4 @@ RunnableWidgetObject::~RunnableWidgetObject()
LogDebug("");
PluginModuleSupport::shutdown(m_ewkContext);
}
-
} /* namespace WRT */
diff --git a/src/api_new/runnable_widget_object.h b/src/api_new/runnable_widget_object.h
index 281781c..1855a14 100644
--- a/src/api_new/runnable_widget_object.h
+++ b/src/api_new/runnable_widget_object.h
@@ -40,16 +40,15 @@ class StateChange;
#include
namespace WRT {
-
class RunnableWidgetObject : public IRunnableWidgetObject
{
-public:
+ public:
RunnableWidgetObject(WidgetModelPtr &model, Ewk_Context* context);
virtual ~RunnableWidgetObject();
bool CheckBeforeLaunch();
bool PrepareView(const std::string &startUrl,
- Evas_Object *window);
+ Evas_Object *window);
void Show(); //asynchronous function
void Hide();
void Suspend();
@@ -61,19 +60,19 @@ public:
void Backward();
void FireJavascriptEvent(int event, void* data);
-private:
+ private:
bool CheckWACTestCertififedWidget();
WidgetModelPtr m_widgetModel;
ViewModule::IViewModulePtr m_view;
Ewk_Context* m_ewkContext;
- void setNewState(std::shared_ptr sptr);
+ void setNewState(
+ std::shared_ptr sptr);
std::shared_ptr m_guardstate;
friend class State::StateChange;
};
-
} /* namespace WRT */
#endif /* RUNNABLE_WIDGET_OBJECT_H_ */
diff --git a/src/api_new/runnable_widget_object_state.cpp b/src/api_new/runnable_widget_object_state.cpp
index bb1990f..6eeedba 100644
--- a/src/api_new/runnable_widget_object_state.cpp
+++ b/src/api_new/runnable_widget_object_state.cpp
@@ -28,34 +28,29 @@
namespace WRT {
namespace State {
-
const StateChange StateChange::NoChange = StateChange();
StateChange::StateChange()
-{
-}
+{}
-StateChange::StateChange(RunnableWidgetObjectStatePtr sptr)
- : m_sptr(sptr)
-{
-}
+StateChange::StateChange(RunnableWidgetObjectStatePtr sptr) :
+ m_sptr(sptr)
+{}
void StateChange::commit()
{
- if(m_sptr)
- {
+ if (m_sptr) {
m_sptr->getObject().setNewState(m_sptr);
}
}
-RunnableWidgetObjectState::RunnableWidgetObjectState(RunnableWidgetObject & object)
- : m_object(object)
-{
-}
+RunnableWidgetObjectState::RunnableWidgetObjectState(
+ RunnableWidgetObject & object) :
+ m_object(object)
+{}
RunnableWidgetObjectState::~RunnableWidgetObjectState()
-{
-}
+{}
RunnableWidgetObject & RunnableWidgetObjectState::getObject() const
{
@@ -138,9 +133,9 @@ StateChange RunnableWidgetObjectState::allowFireJavascriptEvent()
"FireJavascriptEvent cannot be called in current state ");
}
-InitialState::InitialState(RunnableWidgetObject & object) : RunnableWidgetObjectState(object)
-{
-}
+InitialState::InitialState(RunnableWidgetObject & object) :
+ RunnableWidgetObjectState(object)
+{}
std::string InitialState::toString() const
{
@@ -160,17 +155,19 @@ StateChange InitialState::allowHide()
StateChange InitialState::allowGetCurrentWebview()
{
- ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
- "Cannot call GetCurrentWebview before RunnableWidgetObject initialization");
+ ThrowMsg(
+ IRunnableWidgetObject::MethodInvocationForbidden,
+ "Cannot call GetCurrentWebview before RunnableWidgetObject initialization");
}
-PreparedState::PreparedState(RunnableWidgetObject & object) : RunnableWidgetObjectState(object)
-{
-}
+PreparedState::PreparedState(RunnableWidgetObject & object) :
+ RunnableWidgetObjectState(object)
+{}
StateChange PreparedState::allowCheckBeforeLaunch()
{
- return StateChange(RunnableWidgetObjectStatePtr(new SecurityCheckedState(m_object)));
+ return StateChange(RunnableWidgetObjectStatePtr(new SecurityCheckedState(
+ m_object)));
}
std::string PreparedState::toString() const
@@ -178,9 +175,9 @@ std::string PreparedState::toString() const
return "PREPARED";
}
-SecurityCheckedState::SecurityCheckedState(RunnableWidgetObject & object) : RunnableWidgetObjectState(object)
-{
-}
+SecurityCheckedState::SecurityCheckedState(RunnableWidgetObject & object) :
+ RunnableWidgetObjectState(object)
+{}
std::string SecurityCheckedState::toString() const
{
@@ -197,9 +194,9 @@ StateChange SecurityCheckedState::allowSetUserDelegates()
return StateChange::NoChange;
}
-ShowedState::ShowedState(RunnableWidgetObject & object) : RunnableWidgetObjectState(object)
-{
-}
+ShowedState::ShowedState(RunnableWidgetObject & object) :
+ RunnableWidgetObjectState(object)
+{}
std::string ShowedState::toString() const
{
@@ -236,9 +233,9 @@ StateChange ShowedState::allowFireJavascriptEvent()
return StateChange::NoChange;
}
-SuspendedState::SuspendedState(RunnableWidgetObject & object) : RunnableWidgetObjectState(object)
-{
-}
+SuspendedState::SuspendedState(RunnableWidgetObject & object) :
+ RunnableWidgetObjectState(object)
+{}
std::string SuspendedState::toString() const
{
@@ -255,9 +252,9 @@ StateChange SuspendedState::allowReset()
return StateChange(RunnableWidgetObjectStatePtr(new ShowedState(m_object)));
}
-HiddenState::HiddenState(RunnableWidgetObject & object) : RunnableWidgetObjectState(object)
-{
-}
+HiddenState::HiddenState(RunnableWidgetObject & object) :
+ RunnableWidgetObjectState(object)
+{}
std::string HiddenState::toString() const
{
@@ -269,6 +266,5 @@ StateChange HiddenState::allowHide()
ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
"Hide cannot be called in current state" << toString());
}
-
}
}
diff --git a/src/api_new/runnable_widget_object_state.h b/src/api_new/runnable_widget_object_state.h
index 3a246d3..fe9ea13 100644
--- a/src/api_new/runnable_widget_object_state.h
+++ b/src/api_new/runnable_widget_object_state.h
@@ -29,7 +29,6 @@ class RunnableWidgetObject;
namespace State {
class RunnableWidgetObjectState;
}
-
}
#include
@@ -38,7 +37,6 @@ class RunnableWidgetObjectState;
namespace WRT {
namespace State {
-
typedef std::shared_ptr RunnableWidgetObjectStatePtr;
/**
@@ -48,7 +46,7 @@ typedef std::shared_ptr RunnableWidgetObjectStatePtr;
*/
class StateChange
{
-public:
+ public:
static const StateChange NoChange;
StateChange();
@@ -58,7 +56,8 @@ public:
* @brief commit actually performs change of state
*/
void commit();
-private:
+
+ private:
RunnableWidgetObjectStatePtr m_sptr;
};
@@ -73,7 +72,7 @@ private:
*/
class RunnableWidgetObjectState
{
-public:
+ public:
explicit RunnableWidgetObjectState(RunnableWidgetObject & object);
virtual ~RunnableWidgetObjectState();
@@ -94,7 +93,7 @@ public:
virtual std::string toString() const = 0;
virtual RunnableWidgetObject & getObject() const;
-protected:
+ protected:
RunnableWidgetObject & m_object;
};
@@ -103,7 +102,7 @@ protected:
*/
class InitialState : public RunnableWidgetObjectState
{
-public:
+ public:
explicit InitialState(RunnableWidgetObject & object);
std::string toString() const;
@@ -117,7 +116,7 @@ public:
*/
class PreparedState : public RunnableWidgetObjectState
{
-public:
+ public:
explicit PreparedState(RunnableWidgetObject & object);
std::string toString() const;
@@ -129,7 +128,7 @@ public:
*/
class SecurityCheckedState : public RunnableWidgetObjectState
{
-public:
+ public:
explicit SecurityCheckedState(RunnableWidgetObject & object);
std::string toString() const;
@@ -142,7 +141,7 @@ public:
*/
class ShowedState : public RunnableWidgetObjectState
{
-public:
+ public:
explicit ShowedState(RunnableWidgetObject & object);
std::string toString() const;
@@ -159,7 +158,7 @@ public:
*/
class SuspendedState : public RunnableWidgetObjectState
{
-public:
+ public:
explicit SuspendedState(RunnableWidgetObject & object);
std::string toString() const;
@@ -172,13 +171,12 @@ public:
*/
class HiddenState : public RunnableWidgetObjectState
{
-public:
+ public:
explicit HiddenState(RunnableWidgetObject & object);
std::string toString() const;
StateChange allowHide();
};
-
}
}
diff --git a/src/domain/launch_user_data.h b/src/domain/launch_user_data.h
index 755b0ff..c18bc88 100644
--- a/src/domain/launch_user_data.h
+++ b/src/domain/launch_user_data.h
@@ -36,8 +36,7 @@ struct WrtLaunchData {
WrtLaunchData() :
wrtClientContext(NULL),
sdkDebugData(NULL)
- {
- }
+ {}
};
struct SDKDebugData
@@ -50,8 +49,7 @@ struct SDKDebugData
pid(NULL),
portnum(-1),
debugMode(false)
- {
- }
+ {}
SDKDebugData(unsigned long *pidNum,
int portNum,
@@ -59,8 +57,7 @@ struct SDKDebugData
pid(pidNum),
portnum(portNum),
debugMode(currentDebugMode)
- {
- }
+ {}
};
#endif // WRT_LAUNCH_USER_DATA_H_
diff --git a/src/domain/localization_setting.cpp b/src/domain/localization_setting.cpp
index 82e0edb..79aae9e 100644
--- a/src/domain/localization_setting.cpp
+++ b/src/domain/localization_setting.cpp
@@ -25,8 +25,7 @@
#include
-namespace LocalizationSetting{
-
+namespace LocalizationSetting {
void SetLanguageChangedCallback(LanguageChangedCallback cb, void *data)
{
LogDebug("Set language changed callback");
diff --git a/src/domain/localization_setting.h b/src/domain/localization_setting.h
index 7f5dc34..adcca0a 100644
--- a/src/domain/localization_setting.h
+++ b/src/domain/localization_setting.h
@@ -23,11 +23,9 @@
#define LOCALIZATION_SETTING_H_
namespace LocalizationSetting {
-
typedef int (*LanguageChangedCallback)(void *data);
void SetLanguageChangedCallback(LanguageChangedCallback cb, void *data);
-
} //LocalizationSetting
#endif // ifndef LOCALIZATION_SETTING_H_
diff --git a/src/domain/main_thread.cpp b/src/domain/main_thread.cpp
index 9367b92..d2862cc 100644
--- a/src/domain/main_thread.cpp
+++ b/src/domain/main_thread.cpp
@@ -31,8 +31,7 @@ IMPLEMENT_SINGLETON(MainThread)
using namespace WrtDB;
-MainThread::MainThread() : m_attached(false) {
-}
+MainThread::MainThread() : m_attached(false) {}
MainThread::~MainThread()
{
diff --git a/src/domain/main_thread.h b/src/domain/main_thread.h
index ad95089..df00289 100644
--- a/src/domain/main_thread.h
+++ b/src/domain/main_thread.h
@@ -24,7 +24,8 @@
#include
-class MainThread {
+class MainThread
+{
public:
void AttachDatabases();
void DetachDatabases();
diff --git a/src/domain/widget_data_types.cpp b/src/domain/widget_data_types.cpp
index d92197c..2fee42c 100644
--- a/src/domain/widget_data_types.cpp
+++ b/src/domain/widget_data_types.cpp
@@ -21,7 +21,8 @@
/**
* @file widget_data_types.cpp
* @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
- * @author Tomasz Iwanek (t.iwanek@samsung.com) (implementation moved to cpp)
+ * @author Tomasz Iwanek (t.iwanek@samsung.com) (implementation moved to
+ * cpp)
* @version 0.1
* @brief
*/
@@ -31,10 +32,10 @@
#include
WidgetAccessList::WidgetAccessList() : m_isAccessAll(false)
-{
-}
+{}
-WidgetAccessList::WidgetAccessList(const WrtDB::WidgetAccessInfoList &widgetAccessInfoList) :
+WidgetAccessList::WidgetAccessList(
+ const WrtDB::WidgetAccessInfoList &widgetAccessInfoList) :
m_isAccessAll(false)
{
FOREACH(it, widgetAccessInfoList)
@@ -98,8 +99,7 @@ WidgetSettingList::WidgetSettingList() :
m_ContextMenu(ContextMenu_Enable),
m_Encryption(Encryption_Disable),
m_BackgroundSupport(BackgroundSupport_Disable)
-{
-}
+{}
WidgetSettingList::WidgetSettingList(WidgetSettings &widgetSettings)
{
@@ -134,43 +134,46 @@ WidgetSettingList::WidgetSettingList(WidgetSettings &widgetSettings)
m_IndicatorPresence = Indicator_Disable;
} else {
LogError("Invalid indicator presence value!! [" <<
- value << "]");
+ value << "]");
m_IndicatorPresence = Indicator_Enable;
}
} else if (name == SETTING_NAME_BACKBUTTON_PRESENCE) {
if (value == SETTING_VALUE_BACKBUTTON_PRESENCE_ENALBE) {
m_BackButtonPresence = BackButton_Enable;
} else if (value ==
- SETTING_VALUE_BACKBUTTON_PRESENCE_DISABLE) {
+ SETTING_VALUE_BACKBUTTON_PRESENCE_DISABLE)
+ {
m_BackButtonPresence = BackButton_Disable;
} else {
LogError("Invalid backbutton presence value!! [" <<
- value << "]");
+ value << "]");
m_BackButtonPresence = BackButton_Disable;
}
- } else if ( name == SETTING_NAME_CONTEXT_MENU
+ } else if (name == SETTING_NAME_CONTEXT_MENU
#ifndef DEPRECATED_SETTING_STRING
- || name == SETTING_NAME_CONTEXTMENU
+ || name == SETTING_NAME_CONTEXTMENU
#endif
- ) {
+ )
+ {
if (value == SETTING_VALUE_ENABLE) {
m_ContextMenu = ContextMenu_Enable;
} else if (value == SETTING_VALUE_DISABLE) {
m_ContextMenu = ContextMenu_Disable;
} else {
LogError("Invalid contextmenu value!! [" <<
- value << "]");
+ value << "]");
m_ContextMenu = ContextMenu_Enable;
}
} else if (name == SETTING_NAME_ENCRYPTION) {
if (value == SETTING_VALUE_ENCRYPTION_ENABLE) {
m_Encryption = Encryption_Enable;
} else if (value ==
- SETTING_VALUE_ENCRYPTION_DISABLE) {
+ SETTING_VALUE_ENCRYPTION_DISABLE)
+ {
m_Encryption = Encryption_Disable;
} else {
LogError("Invalid encryption value!! [" <<
- value << "]");
+ value << "]");
m_Encryption = Encryption_Disable;
}
} else if (name == SETTING_NAME_BACKGROUND_SUPPORT) {
@@ -180,7 +183,7 @@ WidgetSettingList::WidgetSettingList(WidgetSettings &widgetSettings)
m_BackgroundSupport = BackgroundSupport_Disable;
} else {
LogError("Invalid background-support value!! [" <<
- value << "]");
+ value << "]");
m_BackgroundSupport = BackgroundSupport_Disable;
}
} else if (name == SETTING_NAME_USER_AGENT) {
@@ -210,7 +213,8 @@ WidgetSettingIndicatorPresence WidgetSettingList::getIndicatorPresence() const
return m_IndicatorPresence;
}
-WidgetSettingBackButtonPresence WidgetSettingList::getBackButtonPresence() const
+WidgetSettingBackButtonPresence WidgetSettingList::getBackButtonPresence()
+const
{
return m_BackButtonPresence;
}
@@ -246,10 +250,10 @@ std::string WidgetSettingList::getUserAgent() const
bool WidgetSettingList::operator ==(const WidgetSettingList& other) const
{
return m_RotationLock == other.m_RotationLock &&
- m_IndicatorPresence == other.m_IndicatorPresence &&
- m_BackButtonPresence == other.m_BackButtonPresence &&
- m_ContextMenu == other.m_ContextMenu &&
- m_Encryption == other.m_Encryption &&
- m_BackgroundSupport == other.m_BackgroundSupport &&
- m_UserAgent == other.m_UserAgent;
+ m_IndicatorPresence == other.m_IndicatorPresence &&
+ m_BackButtonPresence == other.m_BackButtonPresence &&
+ m_ContextMenu == other.m_ContextMenu &&
+ m_Encryption == other.m_Encryption &&
+ m_BackgroundSupport == other.m_BackgroundSupport &&
+ m_UserAgent == other.m_UserAgent;
}
diff --git a/src/domain/widget_data_types.h b/src/domain/widget_data_types.h
index a3fcdf4..9d2e73a 100644
--- a/src/domain/widget_data_types.h
+++ b/src/domain/widget_data_types.h
@@ -115,7 +115,7 @@ static const DPL::String SETTING_VALUE_ENABLE =
L"enable";
static const DPL::String SETTING_VALUE_DISABLE =
L"disable";
-static const DPL::String SETTING_NAME_ENCRYPTION=
+static const DPL::String SETTING_NAME_ENCRYPTION =
L"encryption";
static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_PORTRAIT =
L"portrait";
diff --git a/src/domain/widget_deserialize_model.cpp b/src/domain/widget_deserialize_model.cpp
index 6c121d9..3a040a6 100644
--- a/src/domain/widget_deserialize_model.cpp
+++ b/src/domain/widget_deserialize_model.cpp
@@ -27,9 +27,7 @@
// to apply widget default locales instead of calling localizeWidgetModel()
#include
-
namespace Domain {
-
std::shared_ptr deserializeWidgetModel(const std::string& tizenId)
{
std::shared_ptr model;
@@ -40,9 +38,9 @@ std::shared_ptr deserializeWidgetModel(const std::string& tizenId)
WrtDB::WidgetDAOReadOnly dao(dplTizenId);
DPL::Optional defloc = model->defaultlocale.Get();
- if(!defloc.IsNull())
- {
- LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(*defloc);
+ if (!defloc.IsNull()) {
+ LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(
+ *defloc);
}
WrtDB::WidgetAccessInfoList widgetAccessInfoList;
@@ -65,6 +63,5 @@ std::shared_ptr deserializeWidgetModel(const std::string& tizenId)
}
return model;
}
-
} //Namespace Domain
diff --git a/src/domain/widget_deserialize_model.h b/src/domain/widget_deserialize_model.h
index 83eb41f..21a8126 100644
--- a/src/domain/widget_deserialize_model.h
+++ b/src/domain/widget_deserialize_model.h
@@ -28,14 +28,12 @@
#include
namespace Domain {
-
/**
* @brief Creates widget model associated with selected
* @param[in] tizenId
* @retval WidgetModel
*/
std::shared_ptr deserializeWidgetModel(const std::string& tizenId);
-
} //Namespace Domain
#endif // ifndef WRT_ENGINE_SRC_DOMAIN_WIDGET_DESERIALIZE_MODEL_H_
diff --git a/src/domain/widget_model.cpp b/src/domain/widget_model.cpp
index ae62983..2cadbce 100644
--- a/src/domain/widget_model.cpp
+++ b/src/domain/widget_model.cpp
@@ -30,7 +30,7 @@
using namespace WrtDB;
-template
+template
struct BindToWidgetDAO :
DPL::Event::BindToDAO
-{
-};
+{};
template
struct BindToWidgetDAOStatic :
@@ -48,15 +47,14 @@ struct BindToWidgetDAOStatic :
DPL::String,
&WidgetModel::getTizenId,
extFun>
-{
-};
+{};
WidgetModel::WidgetModel(const std::string &tizenId) :
TizenId(DPL::FromASCIIString(tizenId)),
TzPkgId(this, &BindToWidgetDAO::Get),
Type(this, &BindToWidgetDAO::Get),
+ &WidgetDAOReadOnly::getWidgetType>::Get),
ActualSize(this),
PreferredSize(this,
&BindToWidgetDAO::Get),
//localized, so not binded
-// AccessNetwork(this, false),
-// WarpDefinitionEmpty(this),
+ // AccessNetwork(this, false),
+ // WarpDefinitionEmpty(this),
BackSupported(
this,
//TODO this type has to be here now, as Property constructor is wrongly
//chosen
(DPL::Event::Property::ReadDelegateType) &
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached>::
+ ReadDelegateType) &
BindToWidgetDAO::Get),
AccessList(this),
IsTestWidget(
@@ -121,14 +120,14 @@ WidgetModel::WidgetModel(const std::string &tizenId) :
//TODO this type has to be here now, as Property constructor is wrongly
//chosen
(DPL::Event::Property::ReadDelegateType) &
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached>::
+ ReadDelegateType) &
BindToWidgetDAO::Get),
SettingList(this),
AppServiceList(this)
-{
-}
+{}
DPL::String WidgetModel::getTizenId() const
{
diff --git a/src/domain/widget_model.h b/src/domain/widget_model.h
index c261184..e25c31e 100644
--- a/src/domain/widget_model.h
+++ b/src/domain/widget_model.h
@@ -58,8 +58,8 @@ class WidgetModel : public DPL::Event::Model
*/
DPL::String TizenId;
DPL::Event::Property TzPkgId;
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached> TzPkgId;
/**
* @brief Widget type
@@ -67,8 +67,8 @@ class WidgetModel : public DPL::Event::Model
* Note: This is a readonly property
*/
DPL::Event::Property Type;
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached> Type;
/**
* @brief Current widget actual size
@@ -79,8 +79,9 @@ class WidgetModel : public DPL::Event::Model
* @brief Current widget preferred size
*/
DPL::Event::Property PreferredSize;
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached>
+ PreferredSize;
/**
* @brief Start URL for widget
@@ -106,29 +107,32 @@ class WidgetModel : public DPL::Event::Model
* Gets path in which files of widget are being kept
*/
DPL::Event::Property InstallPath;
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached> InstallPath;
/**
* @brief Path to widget's persistent storage.
*
* Gets path in which widget may store its persistent private data.
*/
- DPL::Event::Property PersistentStoragePath;
+ DPL::Event::Property PersistentStoragePath;
/**
* @brief Path to widget's temporary storage.
*
* Gets path in which widget may store its temporary private data.
*/
- DPL::Event::Property TemporaryStoragePath;
+ DPL::Event::Property TemporaryStoragePath;
/**
* @brief Widget defaultlocale
*/
DPL::Event::Property defaultlocale;
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached>
+ defaultlocale;
/**
* @brief Widget name
@@ -164,15 +168,15 @@ class WidgetModel : public DPL::Event::Model
* @brief Widget splash image src
*/
DPL::Event::Property SplashImg;
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached> SplashImg;
/**
* @brief window mode
*/
DPL::Event::Property WindowModes;
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamic> WindowModes;
// /**
// * @brief Value of network element.
@@ -189,8 +193,9 @@ class WidgetModel : public DPL::Event::Model
* @brief Is back supported
*/
DPL::Event::Property BackSupported;
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached>
+ BackSupported;
/**
* @brief Widget access list
@@ -201,9 +206,8 @@ class WidgetModel : public DPL::Event::Model
* @brief Is this DeveloperWidget
*/
DPL::Event::Property IsTestWidget;
-
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached> IsTestWidget;
DPL::Event::Property SettingList;
diff --git a/src/plugin-service/wrt_plugin_module.cpp b/src/plugin-service/wrt_plugin_module.cpp
index 600e5fa..80720a3 100644
--- a/src/plugin-service/wrt_plugin_module.cpp
+++ b/src/plugin-service/wrt_plugin_module.cpp
@@ -30,7 +30,6 @@
#include
namespace PluginModule {
-
void init(int widgetHandle)
{
LogDebug("initializing plugins module");
@@ -102,5 +101,4 @@ void unloadFrame(JSGlobalContextRef context)
LogDebug("unload frame from web page (context:" << context << ")");
PluginLogicSingleton::Instance().unloadFrame(context);
}
-
} // PluginModule
diff --git a/src/plugin-service/wrt_plugin_module.h b/src/plugin-service/wrt_plugin_module.h
index 0203ac7..cd0d85f 100644
--- a/src/plugin-service/wrt_plugin_module.h
+++ b/src/plugin-service/wrt_plugin_module.h
@@ -28,11 +28,10 @@
#include
extern "C" {
- typedef struct OpaqueJSContext* JSGlobalContextRef;
+typedef struct OpaqueJSContext* JSGlobalContextRef;
}
namespace PluginModule {
-
//forward declaration
void init(int widgetHandle);
void start(int widgetHandle,
diff --git a/src/profiling/profiling_util.cpp b/src/profiling/profiling_util.cpp
index 0207711..b8a08ef 100644
--- a/src/profiling/profiling_util.cpp
+++ b/src/profiling/profiling_util.cpp
@@ -55,23 +55,25 @@ struct PacketResult
name(0),
prefix(0),
description(0)
- {
- }
+ {}
PacketResult(unsigned long long t,
- const char* n,
- const char* p,
- const char* d) :
+ const char* n,
+ const char* p,
+ const char* d) :
time(t),
name(n),
prefix(p),
description(d)
- {
- }
+ {}
void Print(FILE *filePtr)
{
- if (!prefix) { prefix = ""; }
- if (!description) { description = ""; }
+ if (!prefix) {
+ prefix = "";
+ }
+ if (!description) {
+ description = "";
+ }
fprintf(filePtr, "%s#%s#%llu#[%s]\n", prefix, name, time, description);
}
};
@@ -134,24 +136,29 @@ std::string GetFormattedTime()
localtime_r(&tv.tv_sec, &localNowTime);
char format[64];
- snprintf(format, sizeof(format), "%02i:%02i:%02i.%03i", localNowTime.tm_hour, localNowTime.tm_min, localNowTime.tm_sec, static_cast(tv.tv_usec / 1000));
+ snprintf(format,
+ sizeof(format),
+ "%02i:%02i:%02i.%03i",
+ localNowTime.tm_hour,
+ localNowTime.tm_min,
+ localNowTime.tm_sec,
+ static_cast(tv.tv_usec / 1000));
return format;
}
-
} // namespace anonymous
void AddStdoutProfilingMeasurment(const char* name, bool start)
{
std::ostringstream output;
- output << "[" << GetFormattedTime() << "] [](): " << name << " ";
+ output << "[" << GetFormattedTime() << "] [](): " << name << " ";
output << (start ? "profiling##start" : "profiling##stop");
fprintf(stdout, "%s\n", output.str().c_str());
}
extern "C"
void AddProfilingMeasurment(const char* name,
- const char* prefix,
- const char* description)
+ const char* prefix,
+ const char* description)
{
DPL::Mutex::ScopedLock lock(m_mutex);
struct timeval value;
diff --git a/src/profiling/profiling_util.h b/src/profiling/profiling_util.h
index 64b909a..13ec532 100644
--- a/src/profiling/profiling_util.h
+++ b/src/profiling/profiling_util.h
@@ -28,14 +28,14 @@
#ifdef __cplusplus
extern "C"
void AddProfilingMeasurment(const char* name,
- const char* prefix = 0,
- const char* description = 0);
+ const char* prefix = 0,
+ const char* description = 0);
#define ADD_PROFILING_POINT(name, ...) AddProfilingMeasurment(name, \
- ## __VA_ARGS__)
+ ##__VA_ARGS__)
#else //__cplusplus
void AddProfilingMeasurment(const char* name,
- const char* prefix,
- const char* description);
+ const char* prefix,
+ const char* description);
#define ADD_PROFILING_POINT(name, prefix, desc) AddProfilingMeasurment(name, \
prefix, \
desc)
diff --git a/src/view/common/application_data.cpp b/src/view/common/application_data.cpp
index 2bfa7fd..23f7fd1 100644
--- a/src/view/common/application_data.cpp
+++ b/src/view/common/application_data.cpp
@@ -30,12 +30,10 @@ IMPLEMENT_SINGLETON(ApplicationData)
ApplicationData::ApplicationData() :
m_originBundle(NULL),
m_encodedBundle(NULL)
-{
-}
+{}
ApplicationData::~ApplicationData()
-{
-}
+{}
bundle* ApplicationData::getBundle() const
{
@@ -49,8 +47,7 @@ const char* ApplicationData::getEncodedBundle() const
bool ApplicationData::setBundle(bundle *originBundle)
{
- if (!originBundle)
- {
+ if (!originBundle) {
LogError("Bundle is empty!");
return false;
}
@@ -64,8 +61,7 @@ bool ApplicationData::setBundle(bundle *originBundle)
bool ApplicationData::setEncodedBundle(bundle* originBundle)
{
int len, ret;
- if (!originBundle)
- {
+ if (!originBundle) {
LogError("Bundle is empty!");
return false;
}
@@ -73,8 +69,7 @@ bool ApplicationData::setEncodedBundle(bundle* originBundle)
freeEncodedBundle();
ret = bundle_encode(originBundle, &m_encodedBundle, &len);
- if(ret == -1)
- {
+ if (ret == -1) {
LogError("Failed to encode bundle data");
return false;
}
@@ -85,13 +80,11 @@ bool ApplicationData::setEncodedBundle(bundle* originBundle)
void ApplicationData::freeBundle()
{
- if (!m_originBundle)
- {
+ if (!m_originBundle) {
return;
}
- if(!bundle_free(m_originBundle))
- {
+ if (!bundle_free(m_originBundle)) {
LogDebug("Bundle data freed for new bundle data");
m_originBundle = NULL;
}
@@ -99,15 +92,13 @@ void ApplicationData::freeBundle()
void ApplicationData::freeEncodedBundle()
{
- if (!m_encodedBundle)
- {
+ if (!m_encodedBundle) {
return;
}
- if(m_encodedBundle)
- {
- if(!bundle_free_encoded_rawdata(
- &m_encodedBundle))
+ if (m_encodedBundle) {
+ if (!bundle_free_encoded_rawdata(
+ &m_encodedBundle))
{
LogDebug("Bundle data freed for new bundle data");
m_encodedBundle = NULL;
diff --git a/src/view/common/application_data.h b/src/view/common/application_data.h
index 1b23a96..7d183ce 100644
--- a/src/view/common/application_data.h
+++ b/src/view/common/application_data.h
@@ -29,22 +29,22 @@
class ApplicationData
{
- public:
- bundle* getBundle() const;
- const char* getEncodedBundle() const;
- bool setBundle(bundle *originBundle);
- bool setEncodedBundle(bundle* originBundle);
- void freeBundle();
- void freeEncodedBundle();
-
- private:
- ApplicationData();
- ~ApplicationData();
-
- bundle* m_originBundle;
- bundle_raw* m_encodedBundle;
-
- friend class DPL::Singleton;
+ public:
+ bundle* getBundle() const;
+ const char* getEncodedBundle() const;
+ bool setBundle(bundle *originBundle);
+ bool setEncodedBundle(bundle* originBundle);
+ void freeBundle();
+ void freeEncodedBundle();
+
+ private:
+ ApplicationData();
+ ~ApplicationData();
+
+ bundle* m_originBundle;
+ bundle_raw* m_encodedBundle;
+
+ friend class DPL::Singleton;
};
typedef DPL::Singleton ApplicationDataSingleton;
diff --git a/src/view/common/application_launcher.cpp b/src/view/common/application_launcher.cpp
old mode 100755
new mode 100644
index 8debb43..0212c81
--- a/src/view/common/application_launcher.cpp
+++ b/src/view/common/application_launcher.cpp
@@ -42,15 +42,13 @@ const char * const SCHEME_TYPE_HTML5_VIDEO = "html5video";
}
ApplicationLauncher::ApplicationLauncher()
-{
-}
+{}
ApplicationLauncher::~ApplicationLauncher()
-{
-}
+{}
void ApplicationLauncher::OnEventReceived(
- const ApplicationLauncherEvents::LaunchApplicationByAppService &event)
+ const ApplicationLauncherEvents::LaunchApplicationByAppService &event)
{
int result;
bundle *args = event.GetArg0();
@@ -58,12 +56,13 @@ void ApplicationLauncher::OnEventReceived(
void *userData = event.GetArg2();
result = appsvc_run_service(args, 0, responseCallback, userData);
- if (result < 0)
+ if (result < 0) {
LogError("Failed to run AppService : " << result);
+ }
}
void ApplicationLauncher::OnEventReceived(
- const ApplicationLauncherEvents::LaunchApplicationByPkgname &event)
+ const ApplicationLauncherEvents::LaunchApplicationByPkgname &event)
{
using namespace ApplicationLauncherPkgname;
LogDebug("LaunchApplicationByPkgname");
@@ -162,7 +161,7 @@ void ApplicationLauncher::OnEventReceived(
url = youtube->getYouTubeHD(uri.c_str());
delete youtube;
} else if (SCHEME_TYPE_RTSP == scheme ||
- (SCHEME_TYPE_HTML5_VIDEO == scheme))
+ (SCHEME_TYPE_HTML5_VIDEO == scheme))
{
url = uri.c_str();
} else {
diff --git a/src/view/common/application_launcher.h b/src/view/common/application_launcher.h
index d33c5e7..d1eb925 100644
--- a/src/view/common/application_launcher.h
+++ b/src/view/common/application_launcher.h
@@ -34,7 +34,7 @@
namespace ApplicationLauncherEvents {
DECLARE_GENERIC_EVENT_3(LaunchApplicationByAppService,
- bundle*,
+ bundle *,
appsvc_res_fn,
void*)
DECLARE_GENERIC_EVENT_4(LaunchApplicationByPkgname,
@@ -45,17 +45,20 @@ DECLARE_GENERIC_EVENT_4(LaunchApplicationByPkgname,
} //namespace ApplicationLauncherEvents
namespace ApplicationLauncherPkgname {
- const std::string PKG_NAME_PREFIX = "com.samsung.";
- const std::string PKG_NAME_DOWNLOAD_PROVIDER = PKG_NAME_PREFIX + "download-provider";
- const std::string PKG_NAME_VIDEO_PLAYER = PKG_NAME_PREFIX + "video-player";
- const std::string PKG_NAME_VT_MAIN = PKG_NAME_PREFIX + "vtmain";
+const std::string PKG_NAME_PREFIX = "com.samsung.";
+const std::string PKG_NAME_DOWNLOAD_PROVIDER = PKG_NAME_PREFIX +
+ "download-provider";
+const std::string PKG_NAME_VIDEO_PLAYER = PKG_NAME_PREFIX + "video-player";
+const std::string PKG_NAME_VT_MAIN = PKG_NAME_PREFIX + "vtmain";
} // namespace ApplicationLauncherPkgname
class ApplicationLauncher :
- public DPL::Event::Controller::Type>
+ public DPL::Event::Controller::Type>
{
public:
ApplicationLauncher();
@@ -64,10 +67,10 @@ class ApplicationLauncher :
protected:
virtual void OnEventReceived(
- const ApplicationLauncherEvents::
+ const ApplicationLauncherEvents::
LaunchApplicationByPkgname &event);
virtual void OnEventReceived(
- const ApplicationLauncherEvents::
+ const ApplicationLauncherEvents::
LaunchApplicationByAppService &event);
private:
diff --git a/src/view/common/evas_object.cpp b/src/view/common/evas_object.cpp
index 087f99d..edc33d4 100644
--- a/src/view/common/evas_object.cpp
+++ b/src/view/common/evas_object.cpp
@@ -17,7 +17,8 @@
* @file evas_object.cpp
* @author Lukasz Wrzosek (l.wrzosel@samsung.com)
* @version 1.0
- * @brief This file is the implementation for Evas_Object wrapper from Efl.
+ * @brief This file is the implementation for Evas_Object wrapper from
+ * Efl.
*/
#include "evas_object.h"
@@ -35,12 +36,11 @@ void EvasObject::IConnection::Disconnect()
EvasObject::IConnection::IConnection(EvasObject::EvasObjectShared* object) :
m_object(object)
-{
-}
+{}
void EvasObject::IConnection::SmartCallbackWrapper(void* data,
- Evas_Object* /*object*/,
- void* event_info)
+ Evas_Object* /*object*/,
+ void* event_info)
{
Assert(data);
IConnection* Calle = static_cast(data);
@@ -48,9 +48,9 @@ void EvasObject::IConnection::SmartCallbackWrapper(void* data,
}
void EvasObject::IConnection::EvasCallbackWrapper(void* data,
- Evas* /*evas*/,
- Evas_Object* /*object*/,
- void* event_info)
+ Evas* /*evas*/,
+ Evas_Object* /*object*/,
+ void* event_info)
{
Assert(data);
IConnection* Calle = static_cast(data);
@@ -63,12 +63,11 @@ Evas_Object* EvasObject::EvasObjectShared::GetObject()
}
EvasObject::EvasObjectShared::SmartConnectionBase::SmartConnectionBase(
- const std::string& name,
- EvasObject::EvasObjectShared* object) :
+ const std::string& name,
+ EvasObject::EvasObjectShared* object) :
IConnection(object),
m_callbackName(name)
-{
-}
+{}
void EvasObject::EvasObjectShared::SmartConnectionBase::ConnectPrv()
{
@@ -85,12 +84,11 @@ void EvasObject::EvasObjectShared::SmartConnectionBase::DisconnectPrv()
}
EvasObject::EvasObjectShared::EvasConnectionBase::EvasConnectionBase(
- Evas_Callback_Type type,
- EvasObject::EvasObjectShared* object) :
+ Evas_Callback_Type type,
+ EvasObject::EvasObjectShared* object) :
IConnection(object),
m_callbackType(type)
-{
-}
+{}
void EvasObject::EvasObjectShared::EvasConnectionBase::ConnectPrv()
{
@@ -108,8 +106,7 @@ void EvasObject::EvasObjectShared::EvasConnectionBase::DisconnectPrv()
EvasObject::EvasObjectShared::EvasObjectShared() :
m_object(NULL)
-{
-}
+{}
EvasObject::EvasObjectShared::EvasObjectShared(Evas_Object* object) :
m_object(object)
@@ -166,9 +163,9 @@ void EvasObject::EvasObjectShared::DisconnectAll()
}
void EvasObject::EvasObjectShared::StaticOnDelEvent(void* data,
- Evas* /*e*/,
- Evas_Object* /*o*/,
- void* /*ev*/)
+ Evas* /*e*/,
+ Evas_Object* /*o*/,
+ void* /*ev*/)
{
Assert(data);
EvasObjectShared* This = static_cast(data);
@@ -183,23 +180,19 @@ void EvasObject::EvasObjectShared::StaticOnDelEvent(void* data,
EvasObject::EvasObject() :
m_object(new EvasObjectShared())
-{
-}
+{}
EvasObject::EvasObject(Evas_Object* object) :
m_object(new EvasObjectShared(object))
-{
-}
+{}
EvasObject::EvasObject(const EvasObject& other) :
m_object(other.m_object)
-{
-}
+{}
//this destructor must be here to let pimpl with shared_ptr work without warning
EvasObject::~EvasObject()
-{
-}
+{}
EvasObject& EvasObject::operator=(const EvasObject& other)
{
diff --git a/src/view/common/evas_object.h b/src/view/common/evas_object.h
index 7f8585d..5073919 100644
--- a/src/view/common/evas_object.h
+++ b/src/view/common/evas_object.h
@@ -49,17 +49,16 @@ class EvasObject
private:
IConnection(EvasObjectShared* object);
virtual ~IConnection()
- {
- }
+ {}
virtual void Call(void* /*event_info*/) = 0;
static void SmartCallbackWrapper(void* data,
- Evas_Object* /*object*/,
- void* event_info);
+ Evas_Object* /*object*/,
+ void* event_info);
static void EvasCallbackWrapper(void* data,
- Evas* /*evas*/,
- Evas_Object* /*object*/,
- void* event_info);
+ Evas* /*evas*/,
+ Evas_Object* /*object*/,
+ void* event_info);
virtual void ConnectPrv() = 0;
virtual void DisconnectPrv() = 0;
@@ -82,7 +81,7 @@ class EvasObject
{
public:
SmartConnectionBase(const std::string& name,
- EvasObjectShared* object);
+ EvasObjectShared* object);
virtual void ConnectPrv();
virtual void DisconnectPrv();
@@ -98,18 +97,16 @@ class EvasObject
Args ... args);
SmartConnection(const std::string& name,
- CbType callback,
- EvasObjectShared* object,
- Args ... args) :
+ CbType callback,
+ EvasObjectShared* object,
+ Args ... args) :
SmartConnectionBase(name, object),
m_callback(callback),
m_args(args ...)
- {
- }
+ {}
virtual ~SmartConnection()
- {
- }
+ {}
virtual void Call(void* event_info)
{
@@ -133,20 +130,18 @@ class EvasObject
void* event_info, ArgType1 *arg1);
SmartMemberConnection1(const std::string& name,
- CbType callback,
- ThisType* callee,
- ArgType1* arg1,
- EvasObjectShared* object) :
+ CbType callback,
+ ThisType* callee,
+ ArgType1* arg1,
+ EvasObjectShared* object) :
SmartConnectionBase(name, object),
m_callback(callback),
m_callee(callee),
m_arg1(arg1)
- {
- }
+ {}
virtual ~SmartMemberConnection1()
- {
- }
+ {}
virtual void Call(void* event_info)
{
@@ -168,22 +163,20 @@ class EvasObject
ArgType2* arg2);
SmartMemberConnection2(const std::string& name,
- CbType callback,
- ThisType* callee,
- ArgType1* arg1,
- ArgType2* arg2,
- EvasObjectShared* object) :
+ CbType callback,
+ ThisType* callee,
+ ArgType1* arg1,
+ ArgType2* arg2,
+ EvasObjectShared* object) :
SmartConnectionBase(name, object),
m_callback(callback),
m_callee(callee),
m_arg1(arg1),
m_arg2(arg2)
- {
- }
+ {}
virtual ~SmartMemberConnection2()
- {
- }
+ {}
virtual void Call(void* event_info)
{
@@ -201,7 +194,7 @@ class EvasObject
{
public:
EvasConnectionBase(Evas_Callback_Type type,
- EvasObjectShared* object);
+ EvasObjectShared* object);
virtual void ConnectPrv();
virtual void DisconnectPrv();
@@ -217,18 +210,16 @@ class EvasObject
ArgType1 *arg1);
EvasConnection1(Evas_Callback_Type type,
- CbType callback,
- ArgType1* arg1,
- EvasObjectShared* object) :
+ CbType callback,
+ ArgType1* arg1,
+ EvasObjectShared* object) :
EvasConnectionBase(type, object),
m_callback(callback),
m_arg1(arg1)
- {
- }
+ {}
virtual ~EvasConnection1()
- {
- }
+ {}
virtual void Call(void* event_info)
{
@@ -248,20 +239,18 @@ class EvasObject
ArgType1 *arg1, ArgType2 *arg2);
EvasConnection2(Evas_Callback_Type type,
- CbType callback,
- ArgType1* arg1,
- ArgType2* arg2,
- EvasObjectShared* object) :
+ CbType callback,
+ ArgType1* arg1,
+ ArgType2* arg2,
+ EvasObjectShared* object) :
EvasConnectionBase(type, object),
m_callback(callback),
m_arg1(arg1),
m_arg2(arg2)
- {
- }
+ {}
virtual ~EvasConnection2()
- {
- }
+ {}
virtual void Call(void* event_info)
{
@@ -282,20 +271,18 @@ class EvasObject
void* event_info, ArgType1 *arg1);
EvasMemberConnection1(Evas_Callback_Type type,
- CbType callback,
- ThisType* callee,
- ArgType1* arg1,
- EvasObjectShared* object) :
+ CbType callback,
+ ThisType* callee,
+ ArgType1* arg1,
+ EvasObjectShared* object) :
EvasConnectionBase(type, object),
m_callback(callback),
m_callee(callee),
m_arg1(arg1)
- {
- }
+ {}
virtual ~EvasMemberConnection1()
- {
- }
+ {}
virtual void Call(void* event_info)
{
@@ -317,22 +304,20 @@ class EvasObject
ArgType2* arg2);
EvasMemberConnection2(Evas_Callback_Type type,
- CbType callback,
- ThisType* callee,
- ArgType1* arg1,
- ArgType2* arg2,
- EvasObjectShared* object) :
+ CbType callback,
+ ThisType* callee,
+ ArgType1* arg1,
+ ArgType2* arg2,
+ EvasObjectShared* object) :
EvasConnectionBase(type, object),
m_callback(callback),
m_callee(callee),
m_arg1(arg1),
m_arg2(arg2)
- {
- }
+ {}
virtual ~EvasMemberConnection2()
- {
- }
+ {}
virtual void Call(void* event_info)
{
@@ -352,9 +337,11 @@ class EvasObject
~EvasObjectShared();
template
- IConnection* ConnectSmartCallback(const char* callbackName,
- typename SmartConnection::CbType callback,
- Args ... args)
+ IConnection* ConnectSmartCallback(
+ const char* callbackName,
+ typename SmartConnection::
+ CbType callback,
+ Args ... args)
{
Assert(m_object);
Assert(callbackName);
@@ -371,12 +358,12 @@ class EvasObject
template
IConnection* ConnectMemberSmartCallback(
- const char* callbackName,
- typename SmartMemberConnection2::CbType callback,
- ThisType* callee,
- ArgType1* arg1,
- ArgType2* arg2)
+ const char* callbackName,
+ typename SmartMemberConnection2::CbType callback,
+ ThisType* callee,
+ ArgType1* arg1,
+ ArgType2* arg2)
{
Assert(m_object);
Assert(callee);
@@ -397,11 +384,11 @@ class EvasObject
template
IConnection* ConnectMemberSmartCallback(
- const char* callbackName,
- typename SmartMemberConnection1::CbType callback,
- ThisType* callee,
- ArgType1* arg1)
+ const char* callbackName,
+ typename SmartMemberConnection1::CbType callback,
+ ThisType* callee,
+ ArgType1* arg1)
{
Assert(m_object);
Assert(callee);
@@ -420,9 +407,11 @@ class EvasObject
template
IConnection* ConnectEvasCallback(Evas_Callback_Type callbackType,
- typename EvasConnection2::CbType callback,
- ArgType1* arg1,
- ArgType2* arg2)
+ typename EvasConnection2::
+ CbType callback,
+ ArgType1* arg1,
+ ArgType2* arg2)
{
Assert(m_object);
Assert(callbackType);
@@ -439,9 +428,11 @@ class EvasObject
}
template
- IConnection* ConnectEvasCallback(Evas_Callback_Type callbackType,
- typename EvasConnection1::CbType callback,
- ArgType1* arg1)
+ IConnection* ConnectEvasCallback(
+ Evas_Callback_Type callbackType,
+ typename EvasConnection1::
+ CbType callback,
+ ArgType1* arg1)
{
Assert(m_object);
Assert(callbackType);
@@ -458,12 +449,12 @@ class EvasObject
template
IConnection* ConnectMemberEvasCallback(
- Evas_Callback_Type callbackType,
- typename EvasMemberConnection2::CbType callback,
- ThisType* callee,
- ArgType1* arg1,
- ArgType2* arg2)
+ Evas_Callback_Type callbackType,
+ typename EvasMemberConnection2::CbType callback,
+ ThisType* callee,
+ ArgType1* arg1,
+ ArgType2* arg2)
{
Assert(m_object);
Assert(callee);
@@ -484,11 +475,11 @@ class EvasObject
template
IConnection* ConnectMemberEvasCallback(
- Evas_Callback_Type callbackType,
- typename EvasMemberConnection1::CbType callback,
- ThisType* callee,
- ArgType1* arg1)
+ Evas_Callback_Type callbackType,
+ typename EvasMemberConnection1::CbType callback,
+ ThisType* callee,
+ ArgType1* arg1)
{
Assert(m_object);
Assert(callee);
@@ -509,9 +500,9 @@ class EvasObject
void DisconnectAll();
static void StaticOnDelEvent(void* data,
- Evas* /*e*/,
- Evas_Object* /*o*/,
- void* /*ev*/);
+ Evas* /*e*/,
+ Evas_Object* /*o*/,
+ void* /*ev*/);
IConnectionsSet m_connections;
Evas_Object* m_object;
@@ -539,10 +530,10 @@ class EvasObject
template
IConnection* ConnectSmartCallback(
- const char* callbackName,
- typename EvasObjectShared::SmartConnection::CbType
- callback,
- Args ... args)
+ const char* callbackName,
+ typename EvasObjectShared::SmartConnection::CbType
+ callback,
+ Args ... args)
{
Assert(m_object);
return m_object->ConnectSmartCallback(callbackName, callback, args ...);
@@ -550,14 +541,14 @@ class EvasObject
template
IConnection* ConnectMemberSmartCallback(
- const char* callbackName,
- typename EvasObjectShared::SmartMemberConnection2::CbType
- callback,
- ThisType* callee,
- ArgType1* arg1,
- ArgType2* arg2)
+ const char* callbackName,
+ typename EvasObjectShared::SmartMemberConnection2::CbType
+ callback,
+ ThisType* callee,
+ ArgType1* arg1,
+ ArgType2* arg2)
{
Assert(m_object);
Assert(callee);
@@ -571,12 +562,12 @@ class EvasObject
template
IConnection* ConnectMemberSmartCallback(
- const char* callbackName,
- typename EvasObjectShared::SmartMemberConnection1::CbType
- callback,
- ThisType* callee,
- ArgType1* arg1)
+ const char* callbackName,
+ typename EvasObjectShared::SmartMemberConnection1::CbType
+ callback,
+ ThisType* callee,
+ ArgType1* arg1)
{
Assert(m_object);
Assert(callee);
@@ -589,11 +580,11 @@ class EvasObject
template
IConnection* ConnectEvasCallback(
- Evas_Callback_Type callbackType,
- typename EvasObjectShared::EvasConnection1::CbType
- callback,
- ArgType1* arg1,
- ArgType2* arg2)
+ Evas_Callback_Type callbackType,
+ typename EvasObjectShared::EvasConnection1::CbType
+ callback,
+ ArgType1* arg1,
+ ArgType2* arg2)
{
Assert(m_object);
return m_object->ConnectEvasCallback(callbackType, callback, arg1, arg2);
@@ -601,10 +592,10 @@ class EvasObject
template
IConnection* ConnectEvasCallback(
- Evas_Callback_Type callbackType,
- typename EvasObjectShared::EvasConnection1::CbType
- callback,
- ArgType1* arg1)
+ Evas_Callback_Type callbackType,
+ typename EvasObjectShared::EvasConnection1::CbType
+ callback,
+ ArgType1* arg1)
{
Assert(m_object);
return m_object->ConnectEvasCallback(callbackType, callback, arg1);
@@ -612,12 +603,12 @@ class EvasObject
template
IConnection* ConnectMemberEvasCallback(
- Evas_Callback_Type callbackType,
- typename EvasObjectShared::EvasMemberConnection1::CbType
- callback,
- ThisType* callee,
- ArgType1* arg1)
+ Evas_Callback_Type callbackType,
+ typename EvasObjectShared::EvasMemberConnection1::CbType
+ callback,
+ ThisType* callee,
+ ArgType1* arg1)
{
Assert(m_object);
Assert(callee);
@@ -630,13 +621,13 @@ class EvasObject
template
IConnection* ConnectMemberEvasCallback(
- Evas_Callback_Type callbackType,
- typename EvasObjectShared::EvasMemberConnection2::CbType
- callback,
- ThisType* callee,
- ArgType1* arg1,
- ArgType2* arg2)
+ Evas_Callback_Type callbackType,
+ typename EvasObjectShared::EvasMemberConnection2::CbType
+ callback,
+ ThisType* callee,
+ ArgType1* arg1,
+ ArgType2* arg2)
{
Assert(m_object);
Assert(callee);
diff --git a/src/view/common/scheme.cpp b/src/view/common/scheme.cpp
index b366190..7539c10 100644
--- a/src/view/common/scheme.cpp
+++ b/src/view/common/scheme.cpp
@@ -24,21 +24,20 @@
#include
namespace ViewModule {
-
namespace {
-
const char * const type2name[Scheme::COUNT] = {
- "file",
- "sms",
- "mmsto",
- "mailto",
- "data",
- "tel",
- "http",
- "https",
- "widget",
- "vnd.youtube",
- "rtsp" };
+ "file",
+ "sms",
+ "mmsto",
+ "mailto",
+ "data",
+ "tel",
+ "http",
+ "https",
+ "widget",
+ "vnd.youtube",
+ "rtsp"
+};
typedef std::map SchemeMap;
@@ -46,7 +45,7 @@ SchemeMap PopulateMap()
{
LogInfo("Populating scheme map...");
SchemeMap map;
- for(size_t st = Scheme::FILE; st" << st);
map[type2name[st]] = static_cast(st);
}
@@ -54,10 +53,10 @@ SchemeMap PopulateMap()
}
const SchemeMap name2type = PopulateMap();
-
} // namespace
-Scheme::Scheme(const std::string& name) : m_name(name), m_type(INVALID) {
+Scheme::Scheme(const std::string& name) : m_name(name), m_type(INVALID)
+{
m_type = GetType(name);
}
@@ -70,11 +69,10 @@ std::string Scheme::GetName (Type type)
Scheme::Type Scheme::GetType(const std::string& name)
{
auto it = name2type.find(name);
- if(it == name2type.end()) {
+ if (it == name2type.end()) {
LogError("Invalid scheme: " << name);
return INVALID;
}
return it->second;
}
-
} /* namespace ViewModule */
diff --git a/src/view/common/scheme.h b/src/view/common/scheme.h
index 5bc5729..e004efa 100644
--- a/src/view/common/scheme.h
+++ b/src/view/common/scheme.h
@@ -25,9 +25,9 @@
#include
namespace ViewModule {
-
-class Scheme {
-public:
+class Scheme
+{
+ public:
enum Type {
INVALID = -1,
FILE = 0,
@@ -48,8 +48,14 @@ public:
explicit Scheme(const std::string& name);
virtual ~Scheme() {}
- std::string GetName() const { return m_name; }
- Type GetType() const { return m_type; }
+ std::string GetName() const
+ {
+ return m_name;
+ }
+ Type GetType() const
+ {
+ return m_type;
+ }
static std::string GetName (Type type);
static std::string GetName (size_t type)
@@ -58,10 +64,9 @@ public:
}
static Type GetType(const std::string& name);
-private:
+ private:
std::string m_name;
Type m_type;
};
-
} /* namespace ViewModule */
#endif /* SCHEME_H_ */
diff --git a/src/view/common/scheme_action_map.cpp b/src/view/common/scheme_action_map.cpp
index 2d2a46a..d27d13a 100644
--- a/src/view/common/scheme_action_map.cpp
+++ b/src/view/common/scheme_action_map.cpp
@@ -31,9 +31,7 @@
#include "scheme_action_map_data.h"
namespace ViewModule {
-
namespace {
-
/*
* Lazy construction pattern.
* TODO Make it more general. Use variadic template/tuples/lambdas or sth. Move
@@ -42,22 +40,32 @@ namespace {
template
class Lazy
{
-public:
+ public:
explicit Lazy(const Arg1& arg1) :
m_arg1(arg1),
m_object(new std::unique_ptr())
- {
- }
+ {}
Lazy(const Lazy& other) :
m_arg1(other.m_arg1),
m_object(other.m_object)
+ {}
+
+ T& operator*()
{
+ return GetObject();
+ }
+ const T& operator*() const
+ {
+ return GetObject();
+ }
+ const T* operator->() const
+ {
+ return &GetObject();
+ }
+ T* operator->()
+ {
+ return &GetObject();
}
-
- T& operator*() { return GetObject(); }
- const T& operator*() const { return GetObject(); }
- const T* operator->() const { return &GetObject(); }
- T* operator->() { return &GetObject(); }
Lazy& operator=(const Lazy& other)
{
@@ -65,7 +73,8 @@ public:
m_object = other.m_object;
return *this;
}
-private:
+
+ private:
T& GetObject() const
{
if (!(*m_object)) {
@@ -84,12 +93,12 @@ private:
* sms:5551212?body=expected%20text => APPSVC_DATA_TEXT + expected%20text
*/
struct AppSvcConversion {
- AppSvcConversion(char const * const keyValue, const std::string& regexStr):
+ AppSvcConversion(char const * const keyValue,
+ const std::string& regexStr) :
key(keyValue),
- regex(regexStr) {
- }
+ regex(regexStr) {}
char const * const key;
- Lazy regex;
+ Lazy regex;
};
/*
@@ -106,14 +115,14 @@ typedef std::map AppSvcOperationMap;
// Regular expressions used to extract appsvc data from scheme
// TODO what about multiple recipients?
-char const * const REGEX_BODY = ".*[?&]body=([^&]+).*";
-char const * const REGEX_SMS = "sms:([^&]+).*";
-char const * const REGEX_MMSTO = "mmsto:([^&]+).*";
-char const * const REGEX_MAILTO = "mailto:([^&]+).*";
-char const * const REGEX_TO = ".*[?&]to=([^&]+).*";
-char const * const REGEX_CC = ".*[?&]cc=([^&]+).*";
-char const * const REGEX_BCC = ".*[?&]bcc=([^&]+).*";
-char const * const REGEX_SUBJECT = ".*[?&]subject=([^&]+).*";
+char const * const REGEX_BODY = ".*[?&]body=([^&]+).*";
+char const * const REGEX_SMS = "sms:([^&]+).*";
+char const * const REGEX_MMSTO = "mmsto:([^&]+).*";
+char const * const REGEX_MAILTO = "mailto:([^&]+).*";
+char const * const REGEX_TO = ".*[?&]to=([^&]+).*";
+char const * const REGEX_CC = ".*[?&]cc=([^&]+).*";
+char const * const REGEX_BCC = ".*[?&]bcc=([^&]+).*";
+char const * const REGEX_SUBJECT = ".*[?&]subject=([^&]+).*";
char const * const REGEX_DATA_CONTEXT = ".*;phone-context=([^:]+).*";
AppSvcOperationMap initializeAppSvcOperations()
@@ -145,11 +154,11 @@ AppSvcOperationMap initializeAppSvcOperations()
sendOp.conversions.push_back(AppSvcConversion(APPSVC_DATA_TO, REGEX_MAILTO));
sendOp.conversions.push_back(AppSvcConversion(APPSVC_DATA_CC, REGEX_CC));
sendOp.conversions.push_back(
- AppSvcConversion(APPSVC_DATA_BCC, REGEX_BCC));
+ AppSvcConversion(APPSVC_DATA_BCC, REGEX_BCC));
sendOp.conversions.push_back(
- AppSvcConversion(APPSVC_DATA_SUBJECT, REGEX_SUBJECT));
+ AppSvcConversion(APPSVC_DATA_SUBJECT, REGEX_SUBJECT));
sendOp.conversions.push_back(
- AppSvcConversion(APPSVC_DATA_TEXT, REGEX_BODY));
+ AppSvcConversion(APPSVC_DATA_TEXT, REGEX_BODY));
ret.insert(std::make_pair(Scheme::MMSTO, sendOp));
ret.insert(std::make_pair(Scheme::MAILTO, sendOp));
@@ -167,12 +176,9 @@ AppSvcOperationMap initializeAppSvcOperations()
}
AppSvcOperationMap g_appSvcOperationMap = initializeAppSvcOperations();
-
} // namespace
-
namespace SchemeActionMap {
-
bool HandleUri(const char* uri,
NavigationContext context,
WrtDB::AppType appType)
@@ -262,29 +268,27 @@ bool HandleUri(const char* uri,
// TODO do we need a callback?
CONTROLLER_POST_EVENT(
- ApplicationLauncher,
- ApplicationLauncherEvents::LaunchApplicationByAppService(
- bundleData,
- NULL,
- NULL));
+ ApplicationLauncher,
+ ApplicationLauncherEvents::LaunchApplicationByAppService(
+ bundleData,
+ NULL,
+ NULL));
break;
}
case URI_ACTION_VIDEO:
CONTROLLER_POST_EVENT(
- ApplicationLauncher,
- ApplicationLauncherEvents::LaunchApplicationByPkgname(
- ApplicationLauncherPkgname::PKG_NAME_VIDEO_PLAYER,
- name,
- uri,
- "null"));
+ ApplicationLauncher,
+ ApplicationLauncherEvents::LaunchApplicationByPkgname(
+ ApplicationLauncherPkgname::PKG_NAME_VIDEO_PLAYER,
+ name,
+ uri,
+ "null"));
break;
default:
break;
}
return (action == URI_ACTION_WRT);
}
-
} // namespace SchemeActionMap
-
} /* namespace ViewModule */
diff --git a/src/view/common/scheme_action_map.h b/src/view/common/scheme_action_map.h
index 558693d..029d3e8 100644
--- a/src/view/common/scheme_action_map.h
+++ b/src/view/common/scheme_action_map.h
@@ -26,10 +26,10 @@
#include
namespace ViewModule {
-
namespace SchemeActionMap {
- bool HandleUri(const char* uri, NavigationContext context, WrtDB::AppType appType);
+bool HandleUri(const char* uri,
+ NavigationContext context,
+ WrtDB::AppType appType);
};
-
} /* namespace ViewModule */
#endif /* SCHEME_ACTION_MAP_H_ */
diff --git a/src/view/common/scheme_action_map_data.h b/src/view/common/scheme_action_map_data.h
index 6710222..3a13f31 100644
--- a/src/view/common/scheme_action_map_data.h
+++ b/src/view/common/scheme_action_map_data.h
@@ -23,9 +23,7 @@
#include
namespace ViewModule {
-
namespace {
-
enum UriAction {
URI_ACTION_WRT, // load in WRT
URI_ACTION_APPSVC, // launch in APPSVC
@@ -61,38 +59,34 @@ enum UriAction {
// TIZEN
const UriAction g_tizenActionMap[Scheme::COUNT][SchemeActionMap::COUNT] = {
-
-// TOP_LEVEL FRAME_LEVEL NEW_WINDOW
- {URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT}, // FILE
- {URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC}, // SMS
- {URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC}, // MMSTO
- {URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC}, // MAILTO
- {URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT}, // DATA
- {URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC}, // TEL
- {URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT}, // HTTP
- {URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT}, // HTTPS
- {URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT}, // WIDGET
- {URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO}, // YOUTUBE
- {URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO} // RTSP
+ // TOP_LEVEL FRAME_LEVEL NEW_WINDOW
+ { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT }, // FILE
+ { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC }, // SMS
+ { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC }, // MMSTO
+ { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC }, // MAILTO
+ { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT }, // DATA
+ { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC }, // TEL
+ { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT }, // HTTP
+ { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT }, // HTTPS
+ { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT }, // WIDGET
+ { URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO }, // YOUTUBE
+ { URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO } // RTSP
};
// WAC
const UriAction g_wacActionMap[Scheme::COUNT][SchemeActionMap::COUNT] = {
-
-// TOP_LEVEL FRAME_LEVEL NEW_WINDOW
- {URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_APPSVC}, // FILE
- {URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC}, // SMS
- {URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC}, // MMSTO
- {URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC}, // MAILTO
- {URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT}, // DATA
- {URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC}, // TEL
- {URI_ACTION_APPSVC, URI_ACTION_WRT, URI_ACTION_APPSVC}, // HTTP
- {URI_ACTION_APPSVC, URI_ACTION_WRT, URI_ACTION_APPSVC}, // HTTPS
- {URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_APPSVC}, // WIDGET
- {URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO}, // YOUTUBE
- {URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO} // RTSP
+ // TOP_LEVEL FRAME_LEVEL NEW_WINDOW
+ { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_APPSVC }, // FILE
+ { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC }, // SMS
+ { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC }, // MMSTO
+ { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC }, // MAILTO
+ { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT }, // DATA
+ { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC }, // TEL
+ { URI_ACTION_APPSVC, URI_ACTION_WRT, URI_ACTION_APPSVC }, // HTTP
+ { URI_ACTION_APPSVC, URI_ACTION_WRT, URI_ACTION_APPSVC }, // HTTPS
+ { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_APPSVC }, // WIDGET
+ { URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO }, // YOUTUBE
+ { URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO } // RTSP
};
-
}
-
}
diff --git a/src/view/common/scheme_action_map_type.h b/src/view/common/scheme_action_map_type.h
index 05e3bb7..334e01e 100644
--- a/src/view/common/scheme_action_map_type.h
+++ b/src/view/common/scheme_action_map_type.h
@@ -24,13 +24,13 @@
namespace ViewModule {
namespace SchemeActionMap {
- enum NavigationContext {
- TOP_LEVEL = 0,
- FRAME_LEVEL,
- NEW_WINDOW,
+enum NavigationContext {
+ TOP_LEVEL = 0,
+ FRAME_LEVEL,
+ NEW_WINDOW,
- COUNT
- };
+ COUNT
+};
} // namespace SchemeActionMap
} // namespace ViewModule
#endif /* SCHEME_ACTION_MAP_TYPE_H_ */
diff --git a/src/view/common/view_logic_apps_support.cpp b/src/view/common/view_logic_apps_support.cpp
index 84e48c0..9aeafd1 100644
--- a/src/view/common/view_logic_apps_support.cpp
+++ b/src/view/common/view_logic_apps_support.cpp
@@ -28,7 +28,6 @@
#include
namespace ViewModule {
-
namespace {
const char* const SCHEME_TYPE_HTML5_VIDEO = "html5video";
const char* const HTTP_STREAMING_MPEG_MIMETYPE = "application/x-mpegurl";
@@ -52,8 +51,7 @@ class AppsSupportImplementation
AppsSupportImplementation() :
m_widgetModel(NULL),
m_initialized(false)
- {
- }
+ {}
~AppsSupportImplementation()
{
@@ -72,7 +70,7 @@ class AppsSupportImplementation
ApplicationLauncherSingleton::Instance().Touch();
ApplicationLauncherSingleton::Instance().setWidgetTizenId(
- DPL::ToUTF8String(m_widgetModel->TizenId));
+ DPL::ToUTF8String(m_widgetModel->TizenId));
LogDebug("Initialized");
m_initialized = true;
@@ -144,8 +142,8 @@ class AppsSupportImplementation
// ignore case match of string of mime type
int isAppServiceable = httpMultimediaRequest(
- mimeType ? std::string(mimeType) : "null",
- url ? std::string(url) : "null");
+ mimeType ? std::string(mimeType) : "null",
+ url ? std::string(url) : "null");
if (isAppServiceable) {
LogInfo("Application Service start");
@@ -183,13 +181,11 @@ class AppsSupportImplementation
}
};
-AppsSupport::AppsSupport(): m_impl(new AppsSupportImplementation)
-{
-}
+AppsSupport::AppsSupport() : m_impl(new AppsSupportImplementation)
+{}
AppsSupport::~AppsSupport()
-{
-}
+{}
void AppsSupport::initialize(WidgetModel *widgetModel)
{
@@ -212,5 +208,4 @@ void AppsSupport::downloadRequest(const char *url,
{
m_impl->downloadRequest(url, mimeType, userParam);
}
-
-}//namespace
+} //namespace
diff --git a/src/view/common/view_logic_apps_support.h b/src/view/common/view_logic_apps_support.h
index a84a671..aeb89fc 100644
--- a/src/view/common/view_logic_apps_support.h
+++ b/src/view/common/view_logic_apps_support.h
@@ -28,7 +28,6 @@
class WidgetModel; //Forward declaration
namespace ViewModule {
-
class AppsSupportImplementation; //Forward declaration
class AppsSupport
@@ -41,14 +40,13 @@ class AppsSupport
void deinitialize();
void html5VideoRequest(void* event_info);
void downloadRequest(
- const char *url,
- const char *mimeType,
- const char *userParam);
+ const char *url,
+ const char *mimeType,
+ const char *userParam);
private:
std::unique_ptr m_impl;
};
-
} //namespace
#endif /* VIEW_LOGIC_APPS_SUPPORT_H_ */
diff --git a/src/view/common/view_logic_custom_header_support.cpp b/src/view/common/view_logic_custom_header_support.cpp
index 3d573d8..3c4b90b 100644
--- a/src/view/common/view_logic_custom_header_support.cpp
+++ b/src/view/common/view_logic_custom_header_support.cpp
@@ -33,7 +33,6 @@ const std::string LANGUAGE_EN = "en";
namespace ViewModule {
namespace CustomHeaderSupport {
-
std::string getValueByField(const std::string field)
{
LogDebug("Field : " << field);
diff --git a/src/view/common/view_logic_custom_header_support.h b/src/view/common/view_logic_custom_header_support.h
index 4e7c386..8b82b18 100644
--- a/src/view/common/view_logic_custom_header_support.h
+++ b/src/view/common/view_logic_custom_header_support.h
@@ -26,9 +26,9 @@
namespace ViewModule {
namespace CustomHeaderSupport {
- const std::string ACCEPT_LANGUAGE = "Accept-Language";
+const std::string ACCEPT_LANGUAGE = "Accept-Language";
- std::string getValueByField(const std::string field);
+std::string getValueByField(const std::string field);
} // namespace UserAgentSupport
} // namespace CustomHeaderSupport
diff --git a/src/view/common/view_logic_geolocation_support.cpp b/src/view/common/view_logic_geolocation_support.cpp
index 45475f6..0dad918 100644
--- a/src/view/common/view_logic_geolocation_support.cpp
+++ b/src/view/common/view_logic_geolocation_support.cpp
@@ -35,27 +35,25 @@ const char * const GEOLOCATION_ASK_MSG =
namespace ViewModule {
namespace GeolocationSupport {
-
bool askUserForPermission()
{
return Wrt::Popup::PopupInvoker().askYesNo(
- GEOLOCATION_ASK_TITLE,
- GEOLOCATION_ASK_MSG);
+ GEOLOCATION_ASK_TITLE,
+ GEOLOCATION_ASK_MSG);
}
bool checkRequestedStateOfGeolocationFeature(WrtDB::WidgetDAOReadOnlyPtr dao)
{
WrtDB::DbWidgetFeature geolocationFeature;
geolocationFeature.name = DPL::FromASCIIString(
- WrtDB::GlobalConfig::GetW3CGeolocationFeatureName() );
+ WrtDB::GlobalConfig::GetW3CGeolocationFeatureName() );
auto features = dao->getFeaturesList();
auto it = features.find(geolocationFeature);
- if ( it != features.end() )
- {
- if(it->rejected){
+ if (it != features.end() ) {
+ if (it->rejected) {
LogInfo("Feature rejected by ACE");
return false;
}
@@ -67,34 +65,31 @@ bool checkRequestedStateOfGeolocationFeature(WrtDB::WidgetDAOReadOnlyPtr dao)
bool getLocalizationState(const DPL::String& tizenId, bool enableHighAccuracy)
{
- LogDebug ("Get localization state");
+ LogDebug("Get localization state");
WrtDB::WidgetDAOReadOnlyPtr dao(new WrtDB::WidgetDAOReadOnly(tizenId));
- if (dao->getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP)
- {
+ if (dao->getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP) {
return askUserForPermission();
}
return checkRequestedStateOfGeolocationFeature(dao) &&
- ViewModule::SecuritySupport::geolocationACECheck(tizenId,
- enableHighAccuracy);
+ ViewModule::SecuritySupport::geolocationACECheck(tizenId,
+ enableHighAccuracy);
}
bool getGeolocationModuleState(const DPL::String& tizenId)
{
- LogDebug ("Get geolocation state");
+ LogDebug("Get geolocation state");
WrtDB::WidgetDAOReadOnlyPtr dao(new WrtDB::WidgetDAOReadOnly(tizenId));
- if (dao->getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP)
- {
+ if (dao->getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP) {
LogInfo("Geolocation enable for tizen app");
return true;
}
return checkRequestedStateOfGeolocationFeature(dao);
}
-
} // namespace GeolocationSupport
} // namespace ViewModule
diff --git a/src/view/common/view_logic_geolocation_support.h b/src/view/common/view_logic_geolocation_support.h
index 3802223..c290058 100644
--- a/src/view/common/view_logic_geolocation_support.h
+++ b/src/view/common/view_logic_geolocation_support.h
@@ -25,7 +25,6 @@
namespace ViewModule {
namespace GeolocationSupport {
-
/*
* @returns true if user allowed for share current position
* @returns false otherwise
@@ -35,11 +34,12 @@ bool getLocalizationState(const DPL::String& tizenId, bool enableHighAccuracy);
/*
* The function returns requested state of geolocation module
*
- * @returns true if geolocation module(navigator.geolocation object) should be enabled
- * false if geolocation module(navigator.geolocation object) should be disabled
+ * @returns true if geolocation module(navigator.geolocation object) should be
+ * enabled
+ * false if geolocation module(navigator.geolocation object) should be
+ * disabled
*/
bool getGeolocationModuleState(const DPL::String& tizenId);
-
}
} // namespace ViewModule
diff --git a/src/view/common/view_logic_password_support.cpp b/src/view/common/view_logic_password_support.cpp
index 1777fa2..95bad28 100644
--- a/src/view/common/view_logic_password_support.cpp
+++ b/src/view/common/view_logic_password_support.cpp
@@ -38,13 +38,12 @@
namespace ViewModule {
namespace PasswordSupport {
-
namespace {
const char *SCHEME_TYPE_HTTP = "http";
const char *SCHEME_TYPE_HTTPS = "https";
-const char *AUTOSAVEIDPASS_OFF = "OFF";
-const char *AUTOSAVEIDPASS_ON = "ON";
-const char *AUTOSAVEIDPASS_ALWAYS_ASK = "ALWAYS_ASK";
+const char *AUTOSAVEIDPASS_OFF = "OFF";
+const char *AUTOSAVEIDPASS_ON = "ON";
+const char *AUTOSAVEIDPASS_ALWAYS_ASK = "ALWAYS_ASK";
// This message isn't confirmed by UX guide
// It should be change to use IDS for translate
const char AUTOSAVE_ASK_MSG[] = "Do you want to remember the password on ";
@@ -88,7 +87,6 @@ Eina_Bool submitFormDataSet(const Eina_Hash* /*hash*/,
return EINA_TRUE;
}
-
}
void submitClicked(std::string uri, Eina_Hash* data)
@@ -199,7 +197,7 @@ DPL::Optional jsForAutoFillData(const char *uri)
FOREACH(iterator, submitData) {
keyOstring << DOUBLE_QUOTES << iterator->key << DOUBLE_QUOTES;
valueOstring << DOUBLE_QUOTES << iterator->value << DOUBLE_QUOTES;
- if (*iterator != submitData.back()) {
+ if (*iterator != submitData.back()) {
keyOstring << COMMA;
valueOstring << COMMA;
}
@@ -245,6 +243,5 @@ DPL::Optional jsForAutoFillData(const char *uri)
return DPL::FromUTF8String(jsStr);
}
-
} // namespaec PasswordSupport
} // namespaec ViewModule
diff --git a/src/view/common/view_logic_password_support.h b/src/view/common/view_logic_password_support.h
index 0f63c9f..aab681c 100644
--- a/src/view/common/view_logic_password_support.h
+++ b/src/view/common/view_logic_password_support.h
@@ -28,10 +28,8 @@
namespace ViewModule {
namespace PasswordSupport {
-
void submitClicked(std::string uri, Eina_Hash* data);
DPL::Optional jsForAutoFillData(const char *uri);
-
} // namespace PasswordSupport
} // namespace ViewModule
diff --git a/src/view/common/view_logic_security_origin_support.cpp b/src/view/common/view_logic_security_origin_support.cpp
index 31fe832..b1c7a77 100644
--- a/src/view/common/view_logic_security_origin_support.cpp
+++ b/src/view/common/view_logic_security_origin_support.cpp
@@ -53,8 +53,7 @@ class SecurityOriginSupportImplementation
}
~SecurityOriginSupportImplementation()
- {
- }
+ {}
SecurityOriginDB::SecurityOriginDAO* getSecurityOriginDAO(void)
{
@@ -63,7 +62,8 @@ class SecurityOriginSupportImplementation
LogDebug("initialize securityOriginDAO");
m_securityOriginDAO =
SecurityOriginDB::SecurityOriginDAOPtr(
- new SecurityOriginDB::SecurityOriginDAO(m_model->TzPkgId.Get()));
+ new SecurityOriginDB::SecurityOriginDAO(m_model->TzPkgId.
+ Get()));
// initialize security result data. Remove allow, deny for
m_securityOriginDAO->removeSecurityOriginData(
SecurityOriginDB::RESULT_ALLOW_ONCE);
@@ -80,16 +80,16 @@ class SecurityOriginSupportImplementation
std::string key;
if (feature == FEATURE_GEOLOCATION) {
key = WrtDB::VconfConfig::GetVconfKeyGeolocationUsage(
- m_model->TizenId);
+ m_model->TizenId);
} else if (feature == FEATURE_WEB_NOTIFICATION) {
key = WrtDB::VconfConfig::GetVconfKeyWebNotificationUsage(
- m_model->TizenId);
+ m_model->TizenId);
} else if (feature == FEATURE_WEB_DATABASE) {
key = WrtDB::VconfConfig::GetVconfKeyWebDatabaseUsage(
- m_model->TizenId);
+ m_model->TizenId);
} else if (feature == FEATURE_FILE_SYSTEM_ACCESS) {
key = WrtDB::VconfConfig::GetVconfKeyFilesystemUsage(
- m_model->TizenId);
+ m_model->TizenId);
} else {
Assert("Wrong feature argument is input");
}
@@ -105,14 +105,13 @@ class SecurityOriginSupportImplementation
SecurityOriginSupport::SecurityOriginSupport(WidgetModel* widgetModel) :
m_impl(new SecurityOriginSupportImplementation(widgetModel))
-{
-}
+{}
SecurityOriginSupport::~SecurityOriginSupport()
-{
-}
+{}
-SecurityOriginDB::SecurityOriginDAO* SecurityOriginSupport::getSecurityOriginDAO(void)
+SecurityOriginDB::SecurityOriginDAO* SecurityOriginSupport::
+ getSecurityOriginDAO(void)
{
return m_impl->getSecurityOriginDAO();
}
@@ -123,11 +122,13 @@ WrtDB::SettingsType SecurityOriginSupport::isNeedPermissionCheck(
return m_impl->isNeedPermissionCheck(feature);
}
-Evas_Object* SecurityOriginSupportUtil::createPopup(Evas_Object* window,
- const char* bodyText,
- const char* checkText,
- Evas_Smart_Cb buttonCallback,
- void* data)
+Evas_Object* SecurityOriginSupportUtil::createPopup(
+ Evas_Object* window,
+ const char* bodyText,
+ const char* checkText,
+ Evas_Smart_Cb
+ buttonCallback,
+ void* data)
{
LogDebug("createPopup");
Evas_Object* popup = elm_popup_add(window);
@@ -187,12 +188,13 @@ Evas_Object* SecurityOriginSupportUtil::getCheck(Evas_Object* popup)
return NULL;
}
Evas_Object* check = elm_object_part_content_get(
- elm_object_content_get(popup),
- "elm.swallow.end");
+ elm_object_content_get(popup),
+ "elm.swallow.end");
return check;
}
-SecurityOriginDB::Result SecurityOriginSupportUtil::getResult(Evas_Object* button)
+SecurityOriginDB::Result SecurityOriginSupportUtil::getResult(
+ Evas_Object* button)
{
using namespace SecurityOriginDB;
@@ -210,9 +212,11 @@ SecurityOriginDB::Result SecurityOriginSupportUtil::getResult(Evas_Object* butto
return RESULT_UNKNOWN;
}
if (allow) {
- return elm_check_state_get(check) ? RESULT_ALLOW_ALWAYS : RESULT_ALLOW_ONCE;
+ return elm_check_state_get(check) ? RESULT_ALLOW_ALWAYS :
+ RESULT_ALLOW_ONCE;
} else {
- return elm_check_state_get(check) ? RESULT_DENY_ALWAYS : RESULT_DENY_ONCE;
+ return elm_check_state_get(check) ? RESULT_DENY_ALWAYS :
+ RESULT_DENY_ONCE;
}
}
} // namespace ViewModule
diff --git a/src/view/common/view_logic_security_origin_support.h b/src/view/common/view_logic_security_origin_support.h
index f7fadc0..2563aec 100644
--- a/src/view/common/view_logic_security_origin_support.h
+++ b/src/view/common/view_logic_security_origin_support.h
@@ -31,11 +31,10 @@
class WidgetModel;
namespace SecurityOriginDB {
- class SecurityOriginDAO;
+class SecurityOriginDAO;
}
namespace ViewModule {
-
class SecurityOriginSupportImplementation;
class SecurityOriginSupport
@@ -63,11 +62,10 @@ class PermissionData
SecurityOriginDB::SecurityOriginDAO* originDao,
SecurityOriginDB::SecurityOriginData originData,
void* data) :
- m_originDao(originDao),
- m_originData(originData),
- m_data(data)
- {
- };
+ m_originDao(originDao),
+ m_originData(originData),
+ m_data(data)
+ {}
};
Evas_Object* createPopup(Evas_Object* window,
@@ -81,5 +79,4 @@ SecurityOriginDB::Result getResult(Evas_Object* button);
};
} // namespace ViewModule
-
#endif // VIEW_LOGIC_SECURITY_ORIGIN_SUPPORT_H_
diff --git a/src/view/common/view_logic_security_support.cpp b/src/view/common/view_logic_security_support.cpp
index 0ea1df0..1c689d0 100644
--- a/src/view/common/view_logic_security_support.cpp
+++ b/src/view/common/view_logic_security_support.cpp
@@ -31,9 +31,7 @@
namespace ViewModule {
namespace SecuritySupport {
-
namespace {
-
const char *GEOLOCATION_DEV_CAP = "geolocation.position";
const char *GEOLOCATION_PARAM_NAME = "param:enableHighAccuracy";
const char *GEOLOCATION_PARAM_VALUE = "true";
@@ -71,12 +69,11 @@ bool simpleAceCheck(
LogDebug("Result is: " << static_cast(result));
- delete [] aceRequest.dev_cap_list.items[0].param_list.items;
- delete [] aceRequest.dev_cap_list.items;
+ delete[] aceRequest.dev_cap_list.items[0].param_list.items;
+ delete[] aceRequest.dev_cap_list.items;
return ACE_OK == ret && ACE_TRUE == result;
}
-
} //TODO copied from view_logic.cpp
bool checkWhitelist(const char *url)
@@ -92,7 +89,8 @@ bool checkWhitelist(const char *url)
return whiteURIList.isRequiredIRI(DPL::FromUTF8String(std::string(url)));
}
-bool geolocationACECheck(const DPL::String& tizenId, bool highAccuracy) {
+bool geolocationACECheck(const DPL::String& tizenId, bool highAccuracy)
+{
const char *paramName = NULL;
const char *paramValue = NULL;
if (highAccuracy) {
@@ -100,11 +98,10 @@ bool geolocationACECheck(const DPL::String& tizenId, bool highAccuracy) {
paramValue = GEOLOCATION_PARAM_VALUE;
}
return simpleAceCheck(
- tizenId,
- GEOLOCATION_DEV_CAP,
- paramName,
- paramValue);
+ tizenId,
+ GEOLOCATION_DEV_CAP,
+ paramName,
+ paramValue);
}
-
} // namespace SecuritySupport
} //namespace ViewModule
diff --git a/src/view/common/view_logic_security_support.h b/src/view/common/view_logic_security_support.h
index 215b207..364c5d5 100644
--- a/src/view/common/view_logic_security_support.h
+++ b/src/view/common/view_logic_security_support.h
@@ -30,12 +30,10 @@ class WidgetModel;
namespace ViewModule {
namespace SecuritySupport {
-
char const * const PARAM_URL = "param:url";
bool checkWhitelist(const char *url);
bool geolocationACECheck(const DPL::String& tizenId, bool highAccuracy);
-
} // namespace SecuritySupport
} // namespace ViewModule
diff --git a/src/view/common/view_logic_storage_support.cpp b/src/view/common/view_logic_storage_support.cpp
index e4fc832..258c637 100644
--- a/src/view/common/view_logic_storage_support.cpp
+++ b/src/view/common/view_logic_storage_support.cpp
@@ -30,10 +30,8 @@
namespace ViewModule {
namespace StorageSupport {
-
-namespace
-{ //anonymous
- const mode_t TEMPORARY_STORAGE_MODE = 0700;
+namespace { //anonymous
+const mode_t TEMPORARY_STORAGE_MODE = 0700;
}
void initializeStorage(WidgetModel *widgetModel)
@@ -43,10 +41,10 @@ void initializeStorage(WidgetModel *widgetModel)
// create temporary storage
std::string path =
- DPL::ToUTF8String(widgetModel->TemporaryStoragePath.Get());
- if(!WrtUtilMakeDir(path, TEMPORARY_STORAGE_MODE)){
+ DPL::ToUTF8String(widgetModel->TemporaryStoragePath.Get());
+ if (!WrtUtilMakeDir(path, TEMPORARY_STORAGE_MODE)) {
ThrowMsg(DPL::CommonException::InternalError,
- "Fail to initialize temporary storage");
+ "Fail to initialize temporary storage");
}
}
@@ -57,12 +55,11 @@ void deinitializeStorage(WidgetModel *widgetModel)
// remove temporary storage
std::string path =
- DPL::ToUTF8String(widgetModel->TemporaryStoragePath.Get());
- if(!WrtUtilRemove(path)){
+ DPL::ToUTF8String(widgetModel->TemporaryStoragePath.Get());
+ if (!WrtUtilRemove(path)) {
ThrowMsg(DPL::CommonException::InternalError,
- "Fail to deinitialize temporary storage");
+ "Fail to deinitialize temporary storage");
}
}
-
} // namespace StorageSupport
} // namespace ViewModule
diff --git a/src/view/common/view_logic_storage_support.h b/src/view/common/view_logic_storage_support.h
index 742b2b4..c7c9eb1 100644
--- a/src/view/common/view_logic_storage_support.h
+++ b/src/view/common/view_logic_storage_support.h
@@ -27,10 +27,8 @@ class WidgetModel;
namespace ViewModule {
namespace StorageSupport {
-
void initializeStorage(WidgetModel *widgetModel);
void deinitializeStorage(WidgetModel *widgetModel);
-
} // namespace StorageSupport
} // namespace ViewModule
diff --git a/src/view/common/view_logic_uri_support.cpp b/src/view/common/view_logic_uri_support.cpp
index d3d7d44..6de0f46 100644
--- a/src/view/common/view_logic_uri_support.cpp
+++ b/src/view/common/view_logic_uri_support.cpp
@@ -36,7 +36,6 @@
namespace ViewModule {
namespace UriSupport {
-
namespace {
enum ServiceDataType
{
@@ -78,7 +77,7 @@ std::vector parseScheme(const std::string &scheme)
if (pos != std::string::npos) {
schemeParts.push_back(scheme.substr(0, pos));
schemeParts.push_back(
- scheme.substr(pos + 1, scheme.length() - pos - 1));
+ scheme.substr(pos + 1, scheme.length() - pos - 1));
}
return schemeParts;
}
@@ -144,47 +143,46 @@ std::string prepareUrl(const std::string &url, const std::string &insert)
}
std::string getCustomHandlerProtocolUri(
- WidgetModel *widgetModel,
- const std::string &schemeType,
- const std::string &schemeValue)
+ WidgetModel *widgetModel,
+ const std::string &schemeType,
+ const std::string &schemeValue)
{
CustomHandlerDB::Interface::attachDatabaseRO();
CustomHandlerDB::CustomHandlerDAOReadOnly handlersDao(widgetModel->TizenId);
CustomHandlerDB::CustomHandlerPtr handler =
- handlersDao.getActivProtocolHandler(
- DPL::FromASCIIString(schemeType));
+ handlersDao.getActivProtocolHandler(
+ DPL::FromASCIIString(schemeType));
CustomHandlerDB::Interface::detachDatabase();
if (handler) {
LogDebug("Found handler, url: " << handler->url);
return prepareUrl(DPL::ToUTF8String(handler->base_url) +
- DPL::ToUTF8String(handler->url), schemeValue);
+ DPL::ToUTF8String(handler->url), schemeValue);
}
return "";
}
std::string getCustomHandlerContentUri(
- WidgetModel *widgetModel,
- const std::string &mime,
- const std::string &mimeValue)
+ WidgetModel *widgetModel,
+ const std::string &mime,
+ const std::string &mimeValue)
{
CustomHandlerDB::Interface::attachDatabaseRO();
CustomHandlerDB::CustomHandlerDAOReadOnly handlersDao(widgetModel->TizenId);
CustomHandlerDB::CustomHandlerPtr handler =
- handlersDao.getActivContentHandler(
- DPL::FromASCIIString(mime));
+ handlersDao.getActivContentHandler(
+ DPL::FromASCIIString(mime));
CustomHandlerDB::Interface::detachDatabase();
if (handler) {
LogDebug("Found handler, url: " << handler->url);
return prepareUrl(DPL::ToUTF8String(handler->base_url) +
- DPL::ToUTF8String(handler->url), mimeValue);
+ DPL::ToUTF8String(handler->url), mimeValue);
}
return "";
}
std::string getAppServiceUri(bundle *bundle, WidgetModel *widgetModel)
{
- if(!bundle)
- {
+ if (!bundle) {
LogError("Bundle is empty");
return std::string("");
}
@@ -221,14 +219,14 @@ std::string getAppServiceUri(bundle *bundle, WidgetModel *widgetModel)
if (schemeParts.size() > 1) {
LogDebug("Scheme parts: " << schemeParts[0] << ", " << schemeParts[1]);
return getCustomHandlerProtocolUri(
- widgetModel, schemeParts[0], schemeParts[1]);
+ widgetModel, schemeParts[0], schemeParts[1]);
}
if (mime != "") {
value = appsvc_get_data(bundle, APPSVC_DATA_SELECTED);
if (value != NULL) {
LogDebug("Use mime type for: " << value);
return getCustomHandlerContentUri(
- widgetModel, mime, std::string(value));
+ widgetModel, mime, std::string(value));
} else {
LogError("Selected file for mime is null, nothind to do");
}
@@ -258,11 +256,12 @@ std::string getUri(WidgetModel *widgetModel, const std::string &defaultUri)
std::string preFix = DPL::ToUTF8String(widgetModel->PrefixURL.Get());
if (strstr(startUri.c_str(), "http") == startUri.c_str() ||
- strstr( startUri.c_str(), preFix.c_str()) == startUri.c_str()) {
+ strstr(startUri.c_str(), preFix.c_str()) == startUri.c_str())
+ {
uri = DPL::FromUTF8String(startUri);
} else {
uri = widgetModel->PrefixURL.Get() +
- DPL::FromUTF8String(startUri);
+ DPL::FromUTF8String(startUri);
}
return DPL::ToUTF8String(uri).c_str();
}
@@ -304,6 +303,5 @@ DPL::OptionalString localizeURI(const DPL::String& inputURI,
return DPL::OptionalString(uri);
}
}
-
} // namespace UriSupportImplementation
} // namespace ViewModule
diff --git a/src/view/common/view_logic_uri_support.h b/src/view/common/view_logic_uri_support.h
index e6b7090..d1dc00e 100644
--- a/src/view/common/view_logic_uri_support.h
+++ b/src/view/common/view_logic_uri_support.h
@@ -31,12 +31,10 @@ class WidgetModel;
namespace ViewModule {
namespace UriSupport {
-
std::string getUri(WidgetModel *widgetModel, const std::string &defaultUri);
DPL::OptionalString localizeURI(const DPL::String& inputURI,
const WidgetModel* model);
-
} // namespace UriSupport
} // namespace ViewModule
diff --git a/src/view/common/view_logic_user_agent_support.cpp b/src/view/common/view_logic_user_agent_support.cpp
index 0f3883e..0e0a05d 100644
--- a/src/view/common/view_logic_user_agent_support.cpp
+++ b/src/view/common/view_logic_user_agent_support.cpp
@@ -36,7 +36,6 @@ const std::string SYSTEM_USER_AGENT = "System user agent";
namespace ViewModule {
namespace UserAgentSupport {
-
std::string getUserAgentFromVconf()
{
using namespace WrtDB;
@@ -68,7 +67,8 @@ std::string getUserAgentFromVconf()
}
} else {
DPL::String value =
- GlobalDAOReadOnly::GetUserAgentValue(DPL::FromUTF8String(userAgentName));
+ GlobalDAOReadOnly::GetUserAgentValue(DPL::FromUTF8String(
+ userAgentName));
userAgent = DPL::ToUTF8String(value);
LogDebug("value : " << value);
}
diff --git a/src/view/common/view_logic_user_agent_support.h b/src/view/common/view_logic_user_agent_support.h
index c37e2e9..c166ecf 100644
--- a/src/view/common/view_logic_user_agent_support.h
+++ b/src/view/common/view_logic_user_agent_support.h
@@ -26,7 +26,7 @@
namespace ViewModule {
namespace UserAgentSupport {
- std::string getUserAgentFromVconf();
+std::string getUserAgentFromVconf();
} // namespace UserAgentSupport
} // namespace ViewModule
diff --git a/src/view/common/view_logic_vibration_support.cpp b/src/view/common/view_logic_vibration_support.cpp
index 8c90818..2185368 100644
--- a/src/view/common/view_logic_vibration_support.cpp
+++ b/src/view/common/view_logic_vibration_support.cpp
@@ -23,12 +23,10 @@
#include
namespace ViewModule {
-
-VibrationSupport::VibrationSupport(): m_initialized(false),
- m_handle(NULL),
- m_effect_handle(NULL)
-{
-}
+VibrationSupport::VibrationSupport() : m_initialized(false),
+ m_handle(NULL),
+ m_effect_handle(NULL)
+{}
VibrationSupport::~VibrationSupport()
{
@@ -45,17 +43,13 @@ void VibrationSupport::deinitialize(void)
{
LogDebug("deinitialize");
- if( m_initialized )
- {
+ if (m_initialized) {
int ret = haptic_close(m_handle);
- if( HAPTIC_ERROR_NONE == ret )
- {
+ if (HAPTIC_ERROR_NONE == ret) {
m_initialized = false;
LogDebug("deinitialize success");
- }
- else
- {
+ } else {
m_initialized = true;
LogDebug("deinitialize failed - error code : " << ret);
}
@@ -66,10 +60,8 @@ void VibrationSupport::startVibration(const long vibrationTime)
{
LogDebug("startVibration called");
- if ( m_initialized == false )
- {
- if ( initializeVibration() == false )
- {
+ if (m_initialized == false) {
+ if (initializeVibration() == false) {
return;
}
}
@@ -77,12 +69,9 @@ void VibrationSupport::startVibration(const long vibrationTime)
int time = static_cast(vibrationTime);
int ret = haptic_vibrate_monotone(m_handle, time, &m_effect_handle);
- if( HAPTIC_ERROR_NONE == ret )
- {
+ if (HAPTIC_ERROR_NONE == ret) {
LogDebug("haptic_vibrate_monotone success");
- }
- else
- {
+ } else {
LogDebug("haptic_vibrate_monotone failed - error code : " << ret);
}
@@ -92,19 +81,15 @@ void VibrationSupport::startVibration(const long vibrationTime)
void VibrationSupport::stopVibration(void)
{
LogDebug("stopVibration called");
- if ( m_initialized == false )
- {
+ if (m_initialized == false) {
return;
}
int ret = haptic_stop_all_effects(m_handle);
- if( HAPTIC_ERROR_NONE == ret )
- {
+ if (HAPTIC_ERROR_NONE == ret) {
LogDebug("haptic_stop_all_effects success");
- }
- else
- {
+ } else {
LogDebug("haptic_stop_all_effects failed - error code : " << ret);
}
@@ -115,20 +100,15 @@ bool VibrationSupport::initializeVibration(void)
{
LogDebug("initializeVibration called");
-
- if ( m_initialized == false )
- {
+ if (m_initialized == false) {
haptic_device_h handle = NULL;
int ret = haptic_open(HAPTIC_DEVICE_0, &handle);
- if ( ret == HAPTIC_ERROR_NONE )
- {
+ if (ret == HAPTIC_ERROR_NONE) {
LogDebug("initializeVibration success");
m_initialized = true;
m_handle = handle;
- }
- else
- {
+ } else {
LogDebug("initializeVibration failed - error code : " << ret);
m_initialized = false;
m_handle = NULL;
@@ -137,5 +117,4 @@ bool VibrationSupport::initializeVibration(void)
return m_initialized;
}
-
} // namespace ViewModule
diff --git a/src/view/common/view_logic_vibration_support.h b/src/view/common/view_logic_vibration_support.h
index 642288d..a9d248c 100644
--- a/src/view/common/view_logic_vibration_support.h
+++ b/src/view/common/view_logic_vibration_support.h
@@ -24,7 +24,6 @@
#include
namespace ViewModule {
-
class VibrationSupport
{
public:
@@ -43,7 +42,6 @@ class VibrationSupport
bool initializeVibration(void);
};
-
} // namespace ViewModule
#endif // VIEW_LOGIC_VIBRATION_SUPPORT_H_
diff --git a/src/view/i_view_module.h b/src/view/i_view_module.h
old mode 100755
new mode 100644
index 8622b01..c63b5d3
--- a/src/view/i_view_module.h
+++ b/src/view/i_view_module.h
@@ -31,13 +31,12 @@
class WidgetModel; //FORWARD DECLARATION
namespace ViewModule {
-
/** \brief Interface to ViewModule. Object of IViewModule type is returned from
* ViewModuleMgr factory.
*/
class IViewModule
{
-public:
+ public:
virtual bool createWebView(Ewk_Context* context,
Evas_Object* window) = 0;
virtual void destroyWebView() = 0;
@@ -46,7 +45,7 @@ public:
virtual void prepareView(WidgetModel *, const std::string &) = 0;
virtual void showWidget() = 0;
virtual void hideWidget() = 0;
- virtual void suspendWidget()= 0;
+ virtual void suspendWidget() = 0;
virtual void resumeWidget() = 0;
virtual void resetWidget() = 0;
virtual void backward() = 0;
@@ -63,7 +62,6 @@ typedef std::shared_ptr IViewModulePtr;
* to IViewModule object.
*/
IViewModulePtr createView();
-
} //namespace
#endif /* WRT_SRC_VIEW_I_VIEW_MODULE_H_ */
diff --git a/src/view/view_module.cpp b/src/view/view_module.cpp
index 2b9d00a..79f1993 100644
--- a/src/view/view_module.cpp
+++ b/src/view/view_module.cpp
@@ -23,13 +23,10 @@
#include "i_view_module.h"
#include
-namespace ViewModule
-{
-
+namespace ViewModule {
IViewModulePtr createView()
{
IViewModulePtr ptr(new ViewLogic());
return ptr;
}
-
} //namespace
diff --git a/src/view/webkit/bundles/bundle_uri_handling.cpp b/src/view/webkit/bundles/bundle_uri_handling.cpp
index 1d34020..656cd89 100644
--- a/src/view/webkit/bundles/bundle_uri_handling.cpp
+++ b/src/view/webkit/bundles/bundle_uri_handling.cpp
@@ -40,18 +40,17 @@
#include
namespace {
-
char const * const SCHEME_TYPE_FILE = "file";
char const * const SCHEME_TYPE_WIDGET = "widget";
char const * const WARP_ERROR_MSG =
- "file:///usr/etc/wrt/warp_security_error.msg";
+ "file:///usr/etc/wrt/warp_security_error.msg";
char const * const PARAM_URL = "param:url";
char const * const ACE_IGNORED_SCHEMA[] = { "file://", "widget://", "data:",
- "tel:", "sms:", "mmsto:", "mailto:", 0 };
+ "tel:", "sms:", "mmsto:", "mailto:",
+ 0 };
WKStringRef block_message = WKStringCreateWithUTF8CString("uri_block_msg");
-
bool checkWARP(const char *url, const DPL::String& tizenId)
{
// ignore WARP in test mode
@@ -69,7 +68,7 @@ bool checkWARP(const char *url, const DPL::String& tizenId)
dao.getWidgetAccessInfo(widgetAccessInfoList);
return (static_cast(widgetAccessInfoList)).isRequiredIRI(
- DPL::FromUTF8String(std::string(url)));
+ DPL::FromUTF8String(std::string(url)));
}
bool checkACE(const char* url, bool xhr, const DPL::String& tizenId)
@@ -101,19 +100,18 @@ bool checkACE(const char* url, bool xhr, const DPL::String& tizenId)
if (xhr) {
aceRequest.dev_cap_list.items[0].name =
- const_cast(devCapNamesXHR);
+ const_cast(devCapNamesXHR);
} else {
aceRequest.dev_cap_list.items[0].name =
- const_cast(devCapNamesMarkup);
+ const_cast(devCapNamesMarkup);
}
aceRequest.dev_cap_list.items[0].param_list.count = 1;
aceRequest.dev_cap_list.items[0].param_list.items = new ace_param_t[1];
aceRequest.dev_cap_list.items[0].param_list.items[0].name =
- const_cast(PARAM_URL);
+ const_cast(PARAM_URL);
aceRequest.dev_cap_list.items[0].param_list.items[0].value =
- const_cast(url);
-
+ const_cast(url);
ace_bool_t result = ACE_FALSE;
@@ -123,31 +121,27 @@ bool checkACE(const char* url, bool xhr, const DPL::String& tizenId)
LogDebug("Result is: " << static_cast(result));
- delete [] aceRequest.dev_cap_list.items[0].param_list.items;
- delete [] aceRequest.dev_cap_list.items;
+ delete[] aceRequest.dev_cap_list.items[0].param_list.items;
+ delete[] aceRequest.dev_cap_list.items;
return ACE_OK == ret && ACE_TRUE == result;
}
-
bool filterURIBySecurity(DPL::OptionalString &op_uri,
- bool is_xhr,
- const DPL::String& tizenId)
+ bool is_xhr,
+ const DPL::String& tizenId)
{
- if (!op_uri)
- {
+ if (!op_uri) {
return true; //accept empty uri
}
auto uri = DPL::ToUTF8String(*op_uri);
- if (!checkWARP(uri.c_str(), tizenId))
- {
+ if (!checkWARP(uri.c_str(), tizenId)) {
LogDebug("Request was blocked by WARP: " << uri);
return false;
}
- if (!checkACE(uri.c_str(), is_xhr, tizenId))
- {
+ if (!checkACE(uri.c_str(), is_xhr, tizenId)) {
LogDebug("Request was blocked by ACE: " << uri);
return false;
}
@@ -157,28 +151,27 @@ bool filterURIBySecurity(DPL::OptionalString &op_uri,
} // namespace (anonymous)
namespace BundleURIHandling {
-
DPL::Optional processURI(const DPL::String& inputURI,
- bool is_xhr, const DPL::String& tizenId, WKBundleRef bundle)
+ bool is_xhr,
+ const DPL::String& tizenId,
+ WKBundleRef bundle)
{
DPL::Optional uri = localizeURI(inputURI, tizenId);
- if (uri.IsNull())
- {
+ if (uri.IsNull()) {
LogDebug("uri is empty");
return uri;
}
// check ACE, WARP
- if (!filterURIBySecurity(uri, is_xhr, tizenId))
- {
+ if (!filterURIBySecurity(uri, is_xhr, tizenId)) {
WKStringRef urlStr = WKStringCreateWithUTF8CString(
DPL::ToUTF8String(*uri).c_str());
WKTypeRef retVal = NULL;
// Send information about blocked URI to view_logic
LogInfo("Sent blocked uri to open browser later : " << uri);
WKBundlePostSynchronousMessage(bundle, block_message,
- urlStr, &retVal);
+ urlStr, &retVal);
WKRelease(urlStr);
WKRelease(retVal);
return DPL::Optional::Null;
@@ -188,7 +181,7 @@ DPL::Optional processURI(const DPL::String& inputURI,
}
DPL::OptionalString localizeURI(const DPL::String& inputURI,
- const DPL::String& tizenId)
+ const DPL::String& tizenId)
{
auto uri = DPL::ToUTF8String(inputURI);
LogDebug("localizing url: " << uri);
@@ -224,5 +217,4 @@ DPL::OptionalString localizeURI(const DPL::String& inputURI,
return DPL::OptionalString(uri);
}
}
-
} // namespace BundleURIHandling
diff --git a/src/view/webkit/bundles/bundle_uri_handling.h b/src/view/webkit/bundles/bundle_uri_handling.h
index 75e3428..28634fa 100644
--- a/src/view/webkit/bundles/bundle_uri_handling.h
+++ b/src/view/webkit/bundles/bundle_uri_handling.h
@@ -27,11 +27,12 @@
#include
namespace BundleURIHandling {
- DPL::Optional processURI(const DPL::String& inputURI,
- bool is_xhr, const DPL::String& tizenId, WKBundleRef bundle);
- DPL::OptionalString localizeURI(const DPL::String& inputURI,
- const DPL::String& tizenId);
+DPL::Optional processURI(const DPL::String& inputURI,
+ bool is_xhr,
+ const DPL::String& tizenId,
+ WKBundleRef bundle);
+DPL::OptionalString localizeURI(const DPL::String& inputURI,
+ const DPL::String& tizenId);
}
-
#endif /* BUNDLE_URI_HANDLING_H_ */
diff --git a/src/view/webkit/bundles/plugin_module_support.cpp b/src/view/webkit/bundles/plugin_module_support.cpp
index 1c56cb8..f59e01f 100644
--- a/src/view/webkit/bundles/plugin_module_support.cpp
+++ b/src/view/webkit/bundles/plugin_module_support.cpp
@@ -28,7 +28,6 @@
#include
namespace PluginModuleSupport {
-
void init(Ewk_Context* ewkContext, const std::string& tizenId)
{
const char* name = BundleMessages::INIT;
@@ -51,21 +50,15 @@ void start(Ewk_Context* ewkContext,
ssMsg << "_" << scale << " ";
- if(encodedBundle)
- {
+ if (encodedBundle) {
ssMsg << "_" << encodedBundle << " ";
- }
- else
- {
+ } else {
ssMsg << "null" << " ";
}
- if(theme)
- {
+ if (theme) {
ssMsg << "_" << theme << " ";
- }
- else
- {
+ } else {
ssMsg << "null" << " ";
}
@@ -86,37 +79,28 @@ void shutdown(Ewk_Context* ewkContext)
}
void setCustomProperties(
- Ewk_Context* ewkContext,
- double* scale,
- const char* encodedBundle,
- const char* theme )
+ Ewk_Context* ewkContext,
+ double* scale,
+ const char* encodedBundle,
+ const char* theme)
{
std::stringstream ssMsg;
- if(scale)
- {
+ if (scale) {
ssMsg << "_" << *scale << " ";
- }
- else
- {
+ } else {
ssMsg << "null" << " ";
}
- if(encodedBundle)
- {
+ if (encodedBundle) {
ssMsg << "_" << encodedBundle << " ";
- }
- else
- {
+ } else {
ssMsg << "null" << " ";
}
- if(theme)
- {
+ if (theme) {
ssMsg << "_" << theme;
- }
- else
- {
+ } else {
ssMsg << "null";
}
@@ -129,9 +113,9 @@ void setCustomProperties(
}
void dispatchJavaScriptEvent(
- Ewk_Context* ewkContext,
- WrtPlugins::W3C::CustomEventType eventType,
- void *data)
+ Ewk_Context* ewkContext,
+ WrtPlugins::W3C::CustomEventType eventType,
+ void *data)
{
using namespace WrtPlugins::W3C;
std::stringstream str;
@@ -166,5 +150,4 @@ void resume(Ewk_Context* ewkContext)
const char* name = BundleMessages::RESUME;
ewk_context_message_post_to_injected_bundle(ewkContext, name, name);
}
-
-}//namespace PluginModuleSupport
+} //namespace PluginModuleSupport
diff --git a/src/view/webkit/bundles/plugin_module_support.h b/src/view/webkit/bundles/plugin_module_support.h
index 4889645..95de035 100644
--- a/src/view/webkit/bundles/plugin_module_support.h
+++ b/src/view/webkit/bundles/plugin_module_support.h
@@ -41,14 +41,14 @@ void suspend(Ewk_Context* ewkContext);
void resume(Ewk_Context* ewkContext);
void setCustomProperties(
- Ewk_Context* ewkContext,
- double* scale = NULL,
- const char* encodedBundle = NULL,
- const char* theme = NULL);
+ Ewk_Context* ewkContext,
+ double* scale = NULL,
+ const char* encodedBundle = NULL,
+ const char* theme = NULL);
void dispatchJavaScriptEvent(
- Ewk_Context* ewkContext,
- WrtPlugins::W3C::CustomEventType eventType,
- void* data);
+ Ewk_Context* ewkContext,
+ WrtPlugins::W3C::CustomEventType eventType,
+ void* data);
} // namespace PluginModuleSupport
#endif /* WRT_SRC_VIEW_WEBKIT2_PLUGIN_MODULE_SUPPORT_H_ */
diff --git a/src/view/webkit/bundles/wrt-wk2-bundle.cpp b/src/view/webkit/bundles/wrt-wk2-bundle.cpp
index fa3f957..4adab07 100644
--- a/src/view/webkit/bundles/wrt-wk2-bundle.cpp
+++ b/src/view/webkit/bundles/wrt-wk2-bundle.cpp
@@ -108,8 +108,7 @@ Bundle::~Bundle()
{
WrtDB::WrtDatabase::detachFromThread();
- if (!m_pagesList.empty())
- {
+ if (!m_pagesList.empty()) {
LogError("There are not closed pages!");
}
@@ -118,9 +117,9 @@ Bundle::~Bundle()
}
void Bundle::didCreatePageCallback(
- WKBundleRef /*bundle*/,
- WKBundlePageRef page,
- const void* clientInfo)
+ WKBundleRef /*bundle*/,
+ WKBundlePageRef page,
+ const void* clientInfo)
{
LOG_PROFILE_START("didCreatePageCallback");
LogDebug("didCreatePageCallback called");
@@ -130,10 +129,10 @@ void Bundle::didCreatePageCallback(
}
void Bundle::didReceiveMessageCallback(
- WKBundleRef /*bundle*/,
- WKStringRef messageName,
- WKTypeRef messageBody,
- const void *clientInfo)
+ WKBundleRef /*bundle*/,
+ WKStringRef messageName,
+ WKTypeRef messageBody,
+ const void *clientInfo)
{
LogDebug("didReceiveMessageCallback called");
Bundle* bundle = static_cast(const_cast(clientInfo));
@@ -141,9 +140,9 @@ void Bundle::didReceiveMessageCallback(
}
void Bundle::willDestroyPageCallback(
- WKBundleRef /*bundle*/,
- WKBundlePageRef page,
- const void* clientInfo)
+ WKBundleRef /*bundle*/,
+ WKBundlePageRef page,
+ const void* clientInfo)
{
LogDebug("willDestroyPageCallback called");
Bundle* This = static_cast(const_cast(clientInfo));
@@ -158,7 +157,7 @@ void Bundle::didCreatePage(WKBundlePageRef page)
m_pageGlobalContext[page] = context;
LogDebug("created Page : " << page << " created JSContext : " << context);
- WKBundlePageResourceLoadClient resourceLoadClient = {
+ WKBundlePageResourceLoadClient resourceLoadClient = {
kWKBundlePageResourceLoadClientCurrentVersion, /* version */
this, /* clientinfo */
0, /* didInitiateLoadForResource */
@@ -177,14 +176,13 @@ void Bundle::didCreatePage(WKBundlePageRef page)
WKBundlePagePolicyClient policyClient = {
kWKBundlePagePolicyClientCurrentVersion, /* version */
this, /* clientInfo */
- pageDecidePolicyForNavigationActionCallback, /* decidePolicyForNavigationAction */
- 0, /* decidePolicyForNewWindowAction */
- pageDecidePolicyForResponseCallback, /* decidePolicyForResponse */
- 0, /* unableToImplementPolicy */
+ pageDecidePolicyForNavigationActionCallback, /**/
+ 0, /* decidePolicyForNewWindowAction */
+ pageDecidePolicyForResponseCallback, /* decidePolicyForResponse */
+ 0, /* unableToImplementPolicy */
};
WKBundlePageSetPolicyClient(page, &policyClient);
-
-};
+}
void Bundle::willDestroyPage(WKBundlePageRef page)
{
@@ -198,25 +196,24 @@ void Bundle::willDestroyPage(WKBundlePageRef page)
PluginModule::stop(context);
}
-void Bundle::fixWKMessageArgs(std::string & argScale, std::string & argEncodedBundle, std::string & argTheme)
+void Bundle::fixWKMessageArgs(std::string & argScale,
+ std::string & argEncodedBundle,
+ std::string & argTheme)
{
- if (argScale != "null" && argScale[0] == '_')
- {
+ if (argScale != "null" && argScale[0] == '_') {
argScale.erase(0, 1);
std::stringstream ssScale(argScale);
ssScale >> m_scale;
}
- if (argEncodedBundle != "null" && argEncodedBundle[0] == '_')
- {
+ if (argEncodedBundle != "null" && argEncodedBundle[0] == '_') {
argEncodedBundle.erase(0, 1);
m_encodedBundle = argEncodedBundle;
}
- if (argTheme != "null" && argTheme[0] == '_')
- {
+ if (argTheme != "null" && argTheme[0] == '_') {
argTheme.erase(0, 1);
m_theme = argTheme;
@@ -256,35 +253,30 @@ void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
// ** Language tags setting completed **
fixWKMessageArgs(argScale, argEncodedBundle, argTheme);
- }
- else if (WKStringIsEqualToUTF8CString(messageName,
- BundleMessages::SHUTDOWN))
+ } else if (WKStringIsEqualToUTF8CString(messageName,
+ BundleMessages::SHUTDOWN))
{
LogDebug("shutdown plugins");
- if (m_pagesList.empty())
- {
+ if (m_pagesList.empty()) {
PluginModule::shutdown();
+ } else {
+ LogInfo(
+ "PluginModule shutdown ignored, there are still alive pages!");
}
- else
- {
- LogInfo("PluginModule shutdown ignored, there are still alive pages!");
- }
- }
- else if (WKStringIsEqualToUTF8CString(messageName,
- BundleMessages::SUSPEND))
+ } else if (WKStringIsEqualToUTF8CString(messageName,
+ BundleMessages::SUSPEND))
{
LogDebug("suspend plugins");
requestSuspend();
- }
- else if (WKStringIsEqualToUTF8CString(messageName,
- BundleMessages::RESUME))
+ } else if (WKStringIsEqualToUTF8CString(messageName,
+ BundleMessages::RESUME))
{
LogDebug("resume plugins");
requestResume();
- }
- else if (WKStringIsEqualToUTF8CString(messageName,
- BundleMessages::SET_CUSTOM_PROPERTIES))
+ } else if (WKStringIsEqualToUTF8CString(messageName,
+ BundleMessages::
+ SET_CUSTOM_PROPERTIES))
{
LogDebug("reset custom properties of window objects");
// set information from ui process
@@ -303,17 +295,15 @@ void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
//apply for each context
PageGlobalContext::iterator it = m_pageGlobalContext.begin();
- for (; it != m_pageGlobalContext.end(); ++it)
- {
+ for (; it != m_pageGlobalContext.end(); ++it) {
PluginModule::setCustomProperties(it->second,
m_scale,
m_encodedBundle.c_str(),
m_theme.c_str());
}
- }
- else if (WKStringIsEqualToUTF8CString(
- messageName,
- BundleMessages::DISPATCH_JAVASCRIPT_EVENT))
+ } else if (WKStringIsEqualToUTF8CString(
+ messageName,
+ BundleMessages::DISPATCH_JAVASCRIPT_EVENT))
{
LogDebug("dispatch javascript event to created frames");
// set information from ui process
@@ -334,21 +324,19 @@ void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
//apply for each context
PageGlobalContext::iterator it = m_pageGlobalContext.begin();
- for (; it != m_pageGlobalContext.end(); ++it)
- {
+ for (; it != m_pageGlobalContext.end(); ++it) {
PluginModule::dispatchJavaScriptEvent(
- it->second,
- static_cast(eventType),
- args);
+ it->second,
+ static_cast(eventType),
+ args);
}
if (args) {
delete static_cast(args);
}
- }
- else if (WKStringIsEqualToUTF8CString(
- messageName,
- BundleMessages::INIT))
+ } else if (WKStringIsEqualToUTF8CString(
+ messageName,
+ BundleMessages::INIT))
{
LogDebug("initializing plugins");
auto msgString = toString(static_cast(messageBody));
@@ -365,11 +353,12 @@ void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
// reset language tags (create new tags based on system locales)
LanguageTagsProviderSingleton::Instance().resetLanguageTags();
DPL::OptionalString defaultLocale = dao.getDefaultlocale();
- if(!defaultLocale.IsNull())
- {
- LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(*defaultLocale);
+ if (!defaultLocale.IsNull()) {
+ LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(
+ *defaultLocale);
}
- LanguageTags tags = LanguageTagsProviderSingleton::Instance().getLanguageTags();
+ LanguageTags tags =
+ LanguageTagsProviderSingleton::Instance().getLanguageTags();
LogDebug("Current widget locales (language tags):");
FOREACH(it, tags) {
LogDebug("Locale: " << *it);
@@ -386,12 +375,12 @@ void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
}
WKURLRequestRef Bundle::willSendRequestForFrameCallback(
- WKBundlePageRef /*page*/,
- WKBundleFrameRef /*frame*/,
- uint64_t /*resourceIdentifier*/,
- WKURLRequestRef request,
- WKURLResponseRef /*response*/,
- const void *clientInfo)
+ WKBundlePageRef /*page*/,
+ WKBundleFrameRef /*frame*/,
+ uint64_t /*resourceIdentifier*/,
+ WKURLRequestRef request,
+ WKURLResponseRef /*response*/,
+ const void *clientInfo)
{
LogDebug("willSendRequestForFrameCallback called");
Bundle* This = static_cast(const_cast(clientInfo));
@@ -399,10 +388,10 @@ WKURLRequestRef Bundle::willSendRequestForFrameCallback(
}
void Bundle::didStartProvisionalLoadForFrameCallback(
- WKBundlePageRef page,
- WKBundleFrameRef frame,
- WKTypeRef* /*userData*/,
- const void *clientInfo)
+ WKBundlePageRef page,
+ WKBundleFrameRef frame,
+ WKTypeRef* /*userData*/,
+ const void *clientInfo)
{
LogDebug("didStartProvisionalLoadForFrameCallback called");
Bundle* This = static_cast(const_cast(clientInfo));
@@ -444,20 +433,18 @@ void Bundle::didStartProvisionalLoadForFrameCallback(
}
void Bundle::didRemoveFrameFromHierarchyCallback(
- WKBundlePageRef page,
- WKBundleFrameRef frame,
- WKTypeRef* /*userData*/,
- const void *clientInfo)
+ WKBundlePageRef page,
+ WKBundleFrameRef frame,
+ WKTypeRef* /*userData*/,
+ const void *clientInfo)
{
LogDebug("didFinishLoadForResourceCallback called");
Bundle* This = static_cast(const_cast(clientInfo));
- if (This->m_pageGlobalContext.count(page) == 0)
- {
+ if (This->m_pageGlobalContext.count(page) == 0) {
return;
}
- if (This->m_pageContext.count(page) == 0)
- {
+ if (This->m_pageContext.count(page) == 0) {
return;
}
@@ -465,8 +452,7 @@ void Bundle::didRemoveFrameFromHierarchyCallback(
ContextSet::iterator i = This->m_pageContext[page].find(context);
- if (i == This->m_pageContext[page].end())
- {
+ if (i == This->m_pageContext[page].end()) {
LogWarning("Tried to unload frame which has never been loaded");
return;
}
@@ -477,10 +463,10 @@ void Bundle::didRemoveFrameFromHierarchyCallback(
}
void Bundle::didFinishLoadForResourceCallback(
- WKBundlePageRef /*page*/,
- WKBundleFrameRef frame,
- uint64_t /*resourceIdentifier*/,
- const void* clientInfo)
+ WKBundlePageRef /*page*/,
+ WKBundleFrameRef frame,
+ uint64_t /*resourceIdentifier*/,
+ const void* clientInfo)
{
LogDebug("didFinishLoadForResourceCallback called");
Bundle* This = static_cast(const_cast(clientInfo));
@@ -490,20 +476,16 @@ void Bundle::didFinishLoadForResourceCallback(
// If url is NULL, this url has been already blocked by willsend
// So current page should be moved to previous page
- if (url == NULL)
- {
- if (WKBundleFrameIsMainFrame(frame))
- {
+ if (url == NULL) {
+ if (WKBundleFrameIsMainFrame(frame)) {
LogInfo("url is NULL. Go back to previous view");
WKStringRef blockedURL =
WKStringCreateWithUTF8CString(URICHANGE_BLOCKED_URL);
WKBundlePostSynchronousMessage(This->m_bundle,
- This->m_uriChangedMessage,
- blockedURL,
- &retVal);
- }
- else
- {
+ This->m_uriChangedMessage,
+ blockedURL,
+ &retVal);
+ } else {
LogInfo("Blocked uri in IFrame.");
}
return;
@@ -512,10 +494,10 @@ void Bundle::didFinishLoadForResourceCallback(
}
void Bundle::didCommitLoadForFrameCallback(
- WKBundlePageRef page,
- WKBundleFrameRef frame,
- WKTypeRef* /*userData*/,
- const void *clientInfo)
+ WKBundlePageRef page,
+ WKBundleFrameRef frame,
+ WKTypeRef* /*userData*/,
+ const void *clientInfo)
{
LogInfo("didCommitLoadForFrameCallback called");
LOG_PROFILE_START("didCommitLoadForFrameCallback");
@@ -533,15 +515,14 @@ void Bundle::didCommitLoadForFrameCallback(
This->m_pageContext[page].insert(context);
- if (!WKBundleFrameIsMainFrame(frame))
- {
+ if (!WKBundleFrameIsMainFrame(frame)) {
LogInfo("frame isn't main frame");
PluginModule::start(
- WrtDB::WidgetDAOReadOnly::getHandle(This->m_widgetTizenId),
- context,
- This->m_scale,
- This->m_encodedBundle.c_str(),
- This->m_theme.c_str());
+ WrtDB::WidgetDAOReadOnly::getHandle(This->m_widgetTizenId),
+ context,
+ This->m_scale,
+ This->m_encodedBundle.c_str(),
+ This->m_theme.c_str());
PluginModule::loadFrame(context);
return;
}
@@ -549,8 +530,7 @@ void Bundle::didCommitLoadForFrameCallback(
std::string scheme = getScheme(toString(url));
std::string result = URICHANGE_PLUGIN_RESTART;
- if (scheme == SCHEME_HTTP || scheme == SCHEME_HTTPS)
- {
+ if (scheme == SCHEME_HTTP || scheme == SCHEME_HTTPS) {
WKStringRef urlStr = WKURLCopyString(url);
WKBundlePostSynchronousMessage(This->m_bundle,
This->m_uriChangedMessage,
@@ -563,21 +543,18 @@ void Bundle::didCommitLoadForFrameCallback(
}
LogInfo("result from UI process : " << result);
- if (result == URICHANGE_PLUGIN_STOP_ONLY)
- {
+ if (result == URICHANGE_PLUGIN_STOP_ONLY) {
PluginModule::stop(context);
- }
- else if (result == URICHANGE_PLUGIN_RESTART)
- {
+ } else if (result == URICHANGE_PLUGIN_RESTART) {
PluginModule::stop(context);
This->m_pageGlobalContext[page] = context;
LOG_PROFILE_START("PluginModule start");
PluginModule::start(
- WrtDB::WidgetDAOReadOnly::getHandle(This->m_widgetTizenId),
- context,
- This->m_scale,
- This->m_encodedBundle.c_str(),
- This->m_theme.c_str() );
+ WrtDB::WidgetDAOReadOnly::getHandle(This->m_widgetTizenId),
+ context,
+ This->m_scale,
+ This->m_encodedBundle.c_str(),
+ This->m_theme.c_str() );
LOG_PROFILE_STOP("PluginModule start");
PluginModule::loadFrame(context);
@@ -586,12 +563,12 @@ void Bundle::didCommitLoadForFrameCallback(
}
WKBundlePagePolicyAction Bundle::pageDecidePolicyForNavigationActionCallback(
- WKBundlePageRef page,
- WKBundleFrameRef frame,
- WKBundleNavigationActionRef navigationAction,
- WKURLRequestRef request,
- WKTypeRef* userData,
- const void* clientInfo)
+ WKBundlePageRef page,
+ WKBundleFrameRef frame,
+ WKBundleNavigationActionRef navigationAction,
+ WKURLRequestRef request,
+ WKTypeRef* userData,
+ const void* clientInfo)
{
LogDebug("pageDecidePolicyForNavigationActionCallback called");
@@ -605,12 +582,12 @@ WKBundlePagePolicyAction Bundle::pageDecidePolicyForNavigationActionCallback(
}
WKBundlePagePolicyAction Bundle::pageDecidePolicyForResponseCallback(
- WKBundlePageRef /* page */,
- WKBundleFrameRef /* frame */,
- WKURLResponseRef response,
- WKURLRequestRef /* request */,
- WKTypeRef* /* userData */,
- const void* /* clientInfo */)
+ WKBundlePageRef /* page */,
+ WKBundleFrameRef /* frame */,
+ WKURLResponseRef response,
+ WKURLRequestRef /* request */,
+ WKTypeRef* /* userData */,
+ const void* /* clientInfo */)
{
LogDebug("pageDecidePolicyForResponseCallback called");
@@ -621,13 +598,11 @@ WKBundlePagePolicyAction Bundle::pageDecidePolicyForResponseCallback(
LogDebug("contentTypeRef : " << contentType);
WKRelease(contentTypeRef);
- if (contentType == HTML_MIME)
- {
+ if (contentType == HTML_MIME) {
LogDebug("Accepting HTML_MIME type");
return WKBundlePagePolicyActionUse;
}
- if (contentType == PHP_MIME)
- {
+ if (contentType == PHP_MIME) {
LogDebug("Accepting php type");
return WKBundlePagePolicyActionUse;
}
@@ -644,15 +619,18 @@ WKURLRequestRef Bundle::willSendRequestForFrame(WKURLRequestRef request)
bool is_xhr = true; // Webkit should inform if it's XHR
DPL::String dplurl = DPL::FromUTF8String(toString(urlStr));
WKRelease(urlStr);
- DPL::Optional newurl = BundleURIHandling::processURI(dplurl,
- is_xhr, m_widgetTizenId, m_bundle);
+ DPL::Optional newurl = BundleURIHandling::processURI(
+ dplurl,
+ is_xhr,
+ m_widgetTizenId,
+ m_bundle);
if (newurl.IsNull()) {
LogDebug("URI is blocked");
WKRelease(url);
return NULL;
} else {
- LogDebug("URI processing result: " << *newurl );
+ LogDebug("URI processing result: " << *newurl);
std::string tmpUrlStr = DPL::ToUTF8String(*newurl);
if (tmpUrlStr.empty()) {
LogDebug("uri is blocked");
@@ -680,16 +658,17 @@ WKURLRequestRef Bundle::willSendRequestForFrame(WKURLRequestRef request)
std::string checkUrl = toString(tmpUrl);
int getFileSize;
- if(m_encrypted) {
- if(isEncryptedResource(checkUrl, getFileSize)) {
+ if (m_encrypted) {
+ if (isEncryptedResource(checkUrl, getFileSize)) {
std::string decryptString = DecryptResource(checkUrl,
- getFileSize);
+ getFileSize);
if (!decryptString.empty()) {
std::string destString = DATA_STRING;
std::string mimeString =
- DPL::ToUTF8String(MimeTypeUtils::identifyFileMimeType(
- DPL::FromUTF8String(checkUrl)));
+ DPL::ToUTF8String(
+ MimeTypeUtils::identifyFileMimeType(
+ DPL::FromUTF8String(checkUrl)));
destString += mimeString;
destString += BASE64_STRING;
@@ -699,7 +678,8 @@ WKURLRequestRef Bundle::willSendRequestForFrame(WKURLRequestRef request)
WKURLRef destUrl =
WKURLCreateWithUTF8CString(decryptString.c_str());
- WKURLRequestRef req = WKURLRequestCreateWithWKURL(destUrl);
+ WKURLRequestRef req = WKURLRequestCreateWithWKURL(
+ destUrl);
WKRelease(destUrl);
LogDebug("return value " << decryptString << "]]");
return req;
@@ -715,11 +695,11 @@ WKURLRequestRef Bundle::willSendRequestForFrame(WKURLRequestRef request)
}
WKBundlePagePolicyAction Bundle::pageDecidePolicyForNavigationAction(
- WKBundlePageRef /* page */,
- WKBundleFrameRef frame,
- WKBundleNavigationActionRef /* navigationAction */,
- WKURLRequestRef request,
- WKTypeRef* /* userData */)
+ WKBundlePageRef /* page */,
+ WKBundleFrameRef frame,
+ WKBundleNavigationActionRef /* navigationAction */,
+ WKURLRequestRef request,
+ WKTypeRef* /* userData */)
{
using namespace ViewModule;
using namespace ViewModule::SchemeActionMap;
@@ -731,8 +711,7 @@ WKBundlePagePolicyAction Bundle::pageDecidePolicyForNavigationAction(
LogInfo("Uri being checked: " << request_uri);
// exception uri
- if( request_uri == BLANK_PAGE_URL )
- {
+ if (request_uri == BLANK_PAGE_URL) {
return WKBundlePagePolicyActionUse;
}
@@ -740,8 +719,7 @@ WKBundlePagePolicyAction Bundle::pageDecidePolicyForNavigationAction(
std::string request_scheme = getScheme(request_uri);
// is tizen schem?
- if ( request_scheme == TIZEN_SCHEME )
- {
+ if (request_scheme == TIZEN_SCHEME) {
return WKBundlePagePolicyActionPassThrough;
}
@@ -764,29 +742,22 @@ WKBundlePagePolicyAction Bundle::pageDecidePolicyForNavigationAction(
UriAction action;
- if (m_widgetType == WrtDB::APP_TYPE_WAC20)
- {
+ if (m_widgetType == WrtDB::APP_TYPE_WAC20) {
action = g_wacActionMap[type][ctx];
- }
- else if (m_widgetType == WrtDB::APP_TYPE_TIZENWEBAPP)
- {
+ } else if (m_widgetType == WrtDB::APP_TYPE_TIZENWEBAPP) {
action = g_tizenActionMap[type][ctx];
- }
- else
- {
+ } else {
LogError("Unsupported application type: " << type);
return WKBundlePagePolicyActionPassThrough;
}
LogDebug("Uri action: " << action);
- if (action == URI_ACTION_WRT)
- {
+ if (action == URI_ACTION_WRT) {
return WKBundlePagePolicyActionUse;
}
return WKBundlePagePolicyActionPassThrough;
-
}
std::string Bundle::toString(WKStringRef str)
@@ -831,8 +802,7 @@ std::string Bundle::getScheme(std::string uri)
std::size_t found = uri.find(':');
std::string str;
- if (found != std::string::npos)
- {
+ if (found != std::string::npos) {
str = uri.substr(0, found);
}
@@ -844,8 +814,8 @@ bool Bundle::isEncryptedResource(std::string Url, int &size)
std::string filePath;
size_t pos = Url.find_first_not_of(SCHEME_FILE);
- if ( std::string::npos != pos) {
- filePath = Url.substr(pos-1);
+ if (std::string::npos != pos) {
+ filePath = Url.substr(pos - 1);
}
if (m_encryptedFiles.empty()) {
@@ -858,8 +828,9 @@ bool Bundle::isEncryptedResource(std::string Url, int &size)
info.fileName = DPL::FromUTF8String(filePath);
if ((0 == strncmp(Url.c_str(), SCHEME_FILE, strlen(SCHEME_FILE))) &&
- (m_encryptedFiles.end() != (it =
- m_encryptedFiles.find(info)))) {
+ (m_encryptedFiles.end() != (it =
+ m_encryptedFiles.find(info))))
+ {
LogDebug(" info file name : " << it->fileName);
LogDebug(" info file size : " << it->fileSize);
size = it->fileSize;
@@ -873,8 +844,8 @@ std::string Bundle::DecryptResource(std::string resource, int size)
std::string filePath;
size_t pos = resource.find_first_not_of(SCHEME_FILE);
- if ( std::string::npos != pos) {
- filePath = resource.substr(pos-1);
+ if (std::string::npos != pos) {
+ filePath = resource.substr(pos - 1);
}
struct stat buf;
@@ -882,7 +853,8 @@ std::string Bundle::DecryptResource(std::string resource, int size)
if (NULL == m_resDec) {
using namespace WrtDB;
m_resDec = new
- WRTDecryptor::ResourceDecryptor(DPL::ToUTF8String(m_widgetTizenId));
+ WRTDecryptor::ResourceDecryptor(DPL::ToUTF8String(
+ m_widgetTizenId));
WrtDB::WidgetDAOReadOnly(m_widgetTizenId).
getEncryptedFileList(m_encryptedFiles);
}
@@ -891,13 +863,13 @@ std::string Bundle::DecryptResource(std::string resource, int size)
memset(contents, 0, bufSize);
FILE* fp = fopen(filePath.c_str(), "rb");
- if ( NULL == fp) {
+ if (NULL == fp) {
LogDebug("Couldnot open file : " << filePath);
return std::string();
}
size_t ret = fread(contents, sizeof(unsigned char), buf.st_size, fp);
- if (ret < static_cast(buf.st_size) ){
+ if (ret < static_cast(buf.st_size) ) {
LogDebug("Couldnot read file : " << filePath);
fclose(fp);
return std::string();
@@ -909,7 +881,7 @@ std::string Bundle::DecryptResource(std::string resource, int size)
unsigned char outDecBuf[bufSize];
memset(outDecBuf, 0, bufSize);
m_resDec->GetDecryptedChunk(contents, outDecBuf, bufSize);
- memset(outDecBuf+size, '\n', bufSize - size);
+ memset(outDecBuf + size, '\n', bufSize - size);
LogDebug("resource need to encoding base64");
BIO *bmem, *b64;
@@ -922,7 +894,7 @@ std::string Bundle::DecryptResource(std::string resource, int size)
BIO_flush(b64);
BIO_get_mem_ptr(b64, &bptr);
- std::string base64Enc((char *)bptr->data, bptr->length-1);
+ std::string base64Enc((char *)bptr->data, bptr->length - 1);
BIO_free_all(b64);
return base64Enc;
@@ -935,7 +907,7 @@ void Bundle::requestSuspend()
LogDebug("Unregister callbacks");
FOREACH(page, m_pagesList)
{
- WKBundlePageSetPageLoaderClient(*page,NULL);
+ WKBundlePageSetPageLoaderClient(*page, NULL);
}
}
@@ -955,7 +927,7 @@ void Bundle::connectLoaderClientCallbacksToPage(WKBundlePageRef page)
WKBundlePageLoaderClient loaderClient = {
kWKBundlePageLoaderClientCurrentVersion,
this, /* clientinfo */
- didStartProvisionalLoadForFrameCallback, /* didStartProvisionalLoadForFrame */
+ didStartProvisionalLoadForFrameCallback, /* StartProvisionLoadForFrm */
0, /* didReceiveServerRedirectForProvisionalLoadForFrame */
0, /* didFailProvisionalLoadWithErrorForFrame */
didCommitLoadForFrameCallback, /* didCommitLoadForFrame */
@@ -987,29 +959,28 @@ void Bundle::connectLoaderClientCallbacksToPage(WKBundlePageRef page)
WKBundlePageSetPageLoaderClient(page, &loaderClient);
}
-
extern "C"
{
- WK_EXPORT
- void WKBundleInitialize(WKBundleRef bundle,
- WKTypeRef)
- {
- DPL::Log::LogSystemSingleton::Instance().SetTag("WRT-BUNDLE");
- LogDebug("Bundle initialized");
-
- DPL::Event::GetMainEventDispatcherInstance().ResetCrossEventCallHandler();
- LogDebug("ResetCrossEventCallHandler()");
-
- static Bundle s_bundle = Bundle(bundle);
-
- WKBundleClient client = {
- kWKBundleClientCurrentVersion,
- &s_bundle,
- &Bundle::didCreatePageCallback,
- &Bundle::willDestroyPageCallback,
- 0, /* didInitializePageGroup */
- &Bundle::didReceiveMessageCallback
- };
- WKBundleSetClient(bundle, &client);
+WK_EXPORT
+void WKBundleInitialize(WKBundleRef bundle,
+ WKTypeRef)
+{
+ DPL::Log::LogSystemSingleton::Instance().SetTag("WRT-BUNDLE");
+ LogDebug("Bundle initialized");
+
+ DPL::Event::GetMainEventDispatcherInstance().ResetCrossEventCallHandler();
+ LogDebug("ResetCrossEventCallHandler()");
+
+ static Bundle s_bundle = Bundle(bundle);
+
+ WKBundleClient client = {
+ kWKBundleClientCurrentVersion,
+ &s_bundle,
+ &Bundle::didCreatePageCallback,
+ &Bundle::willDestroyPageCallback,
+ 0, /* didInitializePageGroup */
+ &Bundle::didReceiveMessageCallback
+ };
+ WKBundleSetClient(bundle, &client);
}
}
diff --git a/src/view/webkit/bundles/wrt-wk2-bundle.h b/src/view/webkit/bundles/wrt-wk2-bundle.h
index 5b91ce4..10c5016 100644
--- a/src/view/webkit/bundles/wrt-wk2-bundle.h
+++ b/src/view/webkit/bundles/wrt-wk2-bundle.h
@@ -33,28 +33,29 @@
#include
extern "C" {
- WK_EXPORT void WKBundleInitialize(WKBundleRef bundle, WKTypeRef);
+WK_EXPORT void WKBundleInitialize(WKBundleRef bundle, WKTypeRef);
}
-class Bundle {
+class Bundle
+{
public:
Bundle(WKBundleRef bundle);
~Bundle();
// WKBundleClient callback
static void didCreatePageCallback(
- WKBundleRef bundle,
- WKBundlePageRef page,
- const void* clientInfo);
+ WKBundleRef bundle,
+ WKBundlePageRef page,
+ const void* clientInfo);
static void willDestroyPageCallback(
- WKBundleRef bundle,
- WKBundlePageRef page,
- const void* clientInfo);
+ WKBundleRef bundle,
+ WKBundlePageRef page,
+ const void* clientInfo);
static void didReceiveMessageCallback(
- WKBundleRef,
- WKStringRef messageName,
- WKTypeRef messageBody,
- const void *clientInfo);
+ WKBundleRef,
+ WKStringRef messageName,
+ WKTypeRef messageBody,
+ const void *clientInfo);
private:
WKStringRef m_uriChangedMessage;
@@ -79,47 +80,47 @@ class Bundle {
// WKBundlePageResourceLoadClient callback
static WKURLRequestRef willSendRequestForFrameCallback(
- WKBundlePageRef,
- WKBundleFrameRef,
- uint64_t resourceIdentifier,
- WKURLRequestRef request,
- WKURLResponseRef,
- const void *clientInfo);
+ WKBundlePageRef,
+ WKBundleFrameRef,
+ uint64_t resourceIdentifier,
+ WKURLRequestRef request,
+ WKURLResponseRef,
+ const void *clientInfo);
static void didFinishLoadForResourceCallback(
- WKBundlePageRef page,
- WKBundleFrameRef frame,
- uint64_t resourceIdentifier,
- const void* clientInfo);
+ WKBundlePageRef page,
+ WKBundleFrameRef frame,
+ uint64_t resourceIdentifier,
+ const void* clientInfo);
// WKBundlePageDidStartProvisionalLoadForFrame callback
static void didStartProvisionalLoadForFrameCallback(
- WKBundlePageRef page,
- WKBundleFrameRef frame,
- WKTypeRef* userData,
- const void *clientInfo);
+ WKBundlePageRef page,
+ WKBundleFrameRef frame,
+ WKTypeRef* userData,
+ const void *clientInfo);
// WKBundlePageDidRemoveFrameFromHierarchy callback
static void didRemoveFrameFromHierarchyCallback(
- WKBundlePageRef page,
- WKBundleFrameRef frame,
- WKTypeRef* userData,
- const void *clientInfo);
+ WKBundlePageRef page,
+ WKBundleFrameRef frame,
+ WKTypeRef* userData,
+ const void *clientInfo);
// WKBundlePageLoaderClient callback
static void didCommitLoadForFrameCallback(
- WKBundlePageRef page,
- WKBundleFrameRef frame,
- WKTypeRef*,
- const void *clientInfo);
+ WKBundlePageRef page,
+ WKBundleFrameRef frame,
+ WKTypeRef*,
+ const void *clientInfo);
// WKBundlePageDecidePolicyForNavigationActionCallback
static WKBundlePagePolicyAction pageDecidePolicyForNavigationActionCallback(
- WKBundlePageRef page,
- WKBundleFrameRef frame,
- WKBundleNavigationActionRef navigationAction,
- WKURLRequestRef request,
- WKTypeRef* userData,
- const void* clientInfo);
+ WKBundlePageRef page,
+ WKBundleFrameRef frame,
+ WKBundleNavigationActionRef navigationAction,
+ WKURLRequestRef request,
+ WKTypeRef* userData,
+ const void* clientInfo);
// WKBundlePageDecidePolicyForResponseCallback
static WKBundlePagePolicyAction pageDecidePolicyForResponseCallback(
@@ -134,16 +135,16 @@ class Bundle {
void didCreatePage(WKBundlePageRef page);
void willDestroyPage(WKBundlePageRef page);
void didReceiveMessage(
- WKStringRef messageName,
- WKTypeRef messageBody);
+ WKStringRef messageName,
+ WKTypeRef messageBody);
// WKBundlePageResourceLoadClient
WKURLRequestRef willSendRequestForFrame(WKURLRequestRef request);
WKBundlePagePolicyAction pageDecidePolicyForNavigationAction(
- WKBundlePageRef page,
- WKBundleFrameRef frame,
+ WKBundlePageRef page,
+ WKBundleFrameRef frame,
WKBundleNavigationActionRef navigationAction,
- WKURLRequestRef request,
+ WKURLRequestRef request,
WKTypeRef* userData);
// basic
@@ -157,14 +158,13 @@ class Bundle {
std::string DecryptResource(std::string resource, int size);
void fixWKMessageArgs(std::string & argScale,
- std::string & argEncodedBundle, std::string & argTheme);
+ std::string & argEncodedBundle,
+ std::string & argTheme);
void requestSuspend();
void requestResume();
void connectLoaderClientCallbacksToPage(WKBundlePageRef page);
-
-
};
#endif /* WRT_SRC_VIEW_WEBKIT2_WRT_WK2_BUNDLE_H_ */
diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp
old mode 100755
new mode 100644
index 59ed640..3914b3f
--- a/src/view/webkit/view_logic.cpp
+++ b/src/view/webkit/view_logic.cpp
@@ -98,67 +98,78 @@ const char * const CERTIFICATE_CONFIRM_REQUEST_ASK_TITLE =
const char * const CERTIFICATE_CONFIRM_REQUEST_ASK_BODY =
"This site's security certificate is not trusted! Do you acess this site?";
-const wchar_t* BACKGROUND_ENABLED = L"background_enabled" ;
-
+const wchar_t* BACKGROUND_ENABLED = L"background_enabled";
} // anonymous namespace
-std::map ViewLogic::m_ewkCallbacksMap =
-{
- {"load,started", &ViewLogic::loadStartedCallback},
- {"load,finished", &ViewLogic::loadFinishedCallback},
- {"title,changed", &ViewLogic::titleChangedCallback},
- {"load,progress", &ViewLogic::loadProgressCallback},
- {"load,progress,finished", &ViewLogic::loadProgressFinishedCallback},
- {"process,crashed", &ViewLogic::processCrashedCallback},
+std::map ViewLogic::m_ewkCallbacksMap = {
+ { "load,started", &ViewLogic::loadStartedCallback },
+ { "load,finished", &ViewLogic::loadFinishedCallback },
+ { "title,changed", &ViewLogic::titleChangedCallback },
+ { "load,progress", &ViewLogic::loadProgressCallback },
+ { "load,progress,finished", &ViewLogic::loadProgressFinishedCallback },
+ { "process,crashed", &ViewLogic::processCrashedCallback },
// WKPageUIClient
- {"create,window", &ViewLogic::createWindowCallback},
- {"close,window", &ViewLogic::closeWindowCallback},
+ { "create,window", &ViewLogic::createWindowCallback },
+ { "close,window", &ViewLogic::closeWindowCallback },
// WKPagePolicyClient
- {"policy,navigation,decide", &ViewLogic::policyNavigationDecideCallback},
- {"policy,newwindow,decide", &ViewLogic::policyNewWindowDecideCallback},
- {"policy,response,decide", &ViewLogic::pageResponseDecideCallback},
+ { "policy,navigation,decide", &ViewLogic::policyNavigationDecideCallback },
+ { "policy,newwindow,decide", &ViewLogic::policyNewWindowDecideCallback },
+ { "policy,response,decide", &ViewLogic::pageResponseDecideCallback },
// WKPageContextMenuClient
- {"contextmenu,customize", &ViewLogic::contextmenuCustomizeCallback},
+ { "contextmenu,customize", &ViewLogic::contextmenuCustomizeCallback },
// WKPageFormClient
- {"form,submit", &ViewLogic::formSubmitCallback},
+ { "form,submit", &ViewLogic::formSubmitCallback },
// EWK Geolocation Callback
- {"request,geolocation,permission", &ViewLogic::geolocationPermissionRequestCallback},
+ { "request,geolocation,permission",
+ &ViewLogic::geolocationPermissionRequestCallback },
// EWK Notification Callback
- {"notification,show", &ViewLogic::notificationShowCallback},
- {"notification,cancel", &ViewLogic::notificationCancelCallback},
- {"notification,permission,request", &ViewLogic::notificationPermissionRequestCallback},
-
- {"database,quota,exceeded", &ViewLogic::databaseUsagePermissionRequestCallback},
- {"filesystem,permission,request", &ViewLogic::fileSystemPermissionRequestCallback},
- {"fullscreen,enterfullscreen", &ViewLogic::enterFullscreenCallback},
- {"fullscreen,exitfullscreen", &ViewLogic::exitFullscreenCallback},
+ { "notification,show", &ViewLogic::notificationShowCallback },
+ { "notification,cancel", &ViewLogic::notificationCancelCallback },
+ { "notification,permission,request",
+ &ViewLogic::notificationPermissionRequestCallback },
+
+ { "database,quota,exceeded",
+ &ViewLogic::databaseUsagePermissionRequestCallback },
+ { "filesystem,permission,request",
+ &ViewLogic::fileSystemPermissionRequestCallback },
+ { "fullscreen,enterfullscreen", &ViewLogic::enterFullscreenCallback },
+ { "fullscreen,exitfullscreen", &ViewLogic::exitFullscreenCallback },
// IME Callback
// when ime start to be showed on the webview,
// this callback will be called
- {"inputmethod,changed", &ViewLogic::imeChangedCallback},
+ { "inputmethod,changed", &ViewLogic::imeChangedCallback },
// this callback will be called
// when ime finishes to be showed on the webview
// "event_info" arg of this callback is always NULL point
// if web content should know size of ime,
// use "inputmethod,changed" instead of this.
//
- {"editorclient,ime,opened", &ViewLogic::imeOpenedCallback},
+ { "editorclient,ime,opened", &ViewLogic::imeOpenedCallback },
// when ime finished to be hidden,
// this callback will be called
- {"editorclient,ime,closed", &ViewLogic::imeClosedCallback},
+ { "editorclient,ime,closed", &ViewLogic::imeClosedCallback },
// EWK Usermedia Callback
- {"usermedia,permission,request", &ViewLogic::usermediaPermissionRequestCallback},
+ { "usermedia,permission,request",
+ &ViewLogic::usermediaPermissionRequestCallback },
// Custom handlers
- {"protocolhandler,registration,requested", &ViewLogic::protocolHandlerRegistrationCallback},
- {"protocolhandler,isregistered", &ViewLogic::protocolHandlerIsRegisteredCallback},
- {"protocolhandler,unregistration,requested", &ViewLogic::protocolHandlerUnregistrationCallback},
- {"contenthandler,registration,requested", &ViewLogic::contentHandlerRegistrationCallback},
- {"contenthandler,isregistered", &ViewLogic::contentHandlerIsRegisteredCallback},
- {"contenthandler,unregistration,requested", &ViewLogic::contentHandlerUnregistrationCallback},
- {"request,certificate,confirm", &ViewLogic::certificateConfirmRequestCallback}
+ { "protocolhandler,registration,requested",
+ &ViewLogic::protocolHandlerRegistrationCallback },
+ { "protocolhandler,isregistered",
+ &ViewLogic::protocolHandlerIsRegisteredCallback },
+ { "protocolhandler,unregistration,requested",
+ &ViewLogic::protocolHandlerUnregistrationCallback },
+ { "contenthandler,registration,requested",
+ &ViewLogic::contentHandlerRegistrationCallback },
+ { "contenthandler,isregistered",
+ &ViewLogic::contentHandlerIsRegisteredCallback },
+ { "contenthandler,unregistration,requested",
+ &ViewLogic::contentHandlerUnregistrationCallback },
+ { "request,certificate,confirm",
+ &ViewLogic::certificateConfirmRequestCallback }
};
-ViewLogic::ViewLogic():
+ViewLogic::ViewLogic() :
m_ewkContext(0),
m_currentEwkView(0),
m_window(NULL),
@@ -169,10 +180,9 @@ ViewLogic::ViewLogic():
m_appsSupport(new ViewModule::AppsSupport()),
m_vibrationSupport(new ViewModule::VibrationSupport()),
m_attachedToCustomHandlerDao(false)
-{
-}
+{}
-ViewLogic::~ViewLogic ()
+ViewLogic::~ViewLogic()
{
detachFromCustomHandlersDao();
}
@@ -185,8 +195,7 @@ bool ViewLogic::createWebView(Ewk_Context* context,
Assert(NULL != m_ewkContext);
Assert(window);
m_window = window;
- if(!createEwkView(evas_object_evas_get(m_window)))
- {
+ if (!createEwkView(evas_object_evas_get(m_window))) {
return false;
}
return true;
@@ -298,7 +307,7 @@ void ViewLogic::suspendWidget()
if (!m_cbs->suspend.empty()) {
m_cbs->suspend(true);
}
-};
+}
void ViewLogic::resumeWidget()
{
@@ -315,19 +324,19 @@ void ViewLogic::resumeWidget()
}
}
- /* window system team recomend removing this win_raise code. */
+ /* window system team recomend removing this win_raise code. */
/*
- if (m_window) {
- elm_win_raise(m_window);
- }
- */
+ * if (m_window) {
+ * elm_win_raise(m_window);
+ * }
+ */
evas_object_focus_set(m_currentEwkView, EINA_TRUE);
// call user callback
if (!m_cbs->resume.empty()) {
m_cbs->resume(true);
}
-};
+}
void ViewLogic::resetWidget()
{
@@ -348,7 +357,7 @@ void ViewLogic::resetWidget()
// check if current url is service url for this tizen service
std::string requestedUri =
- ViewModule::UriSupport::getUri(m_model, m_startUrl);
+ ViewModule::UriSupport::getUri(m_model, m_startUrl);
DPL::OptionalString servicedUri = ViewModule::UriSupport::localizeURI(
DPL::FromUTF8String(requestedUri.c_str()),
m_model);
@@ -461,7 +470,7 @@ void ViewLogic::initializeEwkContext(Ewk_Context* newEwkContext)
ewk_context_proxy_uri_set(newEwkContext, NULL);
} else {
LogInfo("proxy address [" << proxyAddress << "]");
- ewk_context_proxy_uri_set(newEwkContext, proxyAddress);
+ ewk_context_proxy_uri_set(newEwkContext, proxyAddress);
}
if (proxyAddress) {
@@ -489,7 +498,7 @@ void ViewLogic::initializeEwkContext(Ewk_Context* newEwkContext)
this);
ewk_context_certificate_file_set(m_ewkContext,
- "/opt/usr/share/certs/ca-certificate.crt");
+ "/opt/usr/share/certs/ca-certificate.crt");
// set to member value
m_ewkContext = newEwkContext;
@@ -499,27 +508,28 @@ void ViewLogic::finalizeEwkContext()
{
LogInfo("finalizeEwkContext called");
ewk_context_message_from_injected_bundle_callback_set(
- m_ewkContext,
- NULL,
- NULL);
+ m_ewkContext,
+ NULL,
+ NULL);
ewk_context_did_start_download_callback_set(
- m_ewkContext,
- NULL,
- NULL);
+ m_ewkContext,
+ NULL,
+ NULL);
ewk_context_vibration_client_callbacks_set(
- m_ewkContext,
- NULL,
- NULL,
- NULL);
-// ewk_context_delete(m_ewkContext);
-// m_ewkContext = 0;
+ m_ewkContext,
+ NULL,
+ NULL,
+ NULL);
+ // ewk_context_delete(m_ewkContext);
+ // m_ewkContext = 0;
}
void ViewLogic::initializeSupport()
{
// background support
- if( m_model->SettingList.Get().getBackgroundSupport()
- == BackgroundSupport_Enable ) {
+ if (m_model->SettingList.Get().getBackgroundSupport()
+ == BackgroundSupport_Enable)
+ {
LogDebug("Background support enabled, set process active");
pid_t pid = getpid();
sysman_inform_active(pid);
@@ -531,7 +541,7 @@ void ViewLogic::initializeSupport()
WrtDB::PropertyDAOReadOnly::WidgetPropertyValue bgEnableValue =
dao.getPropertyValue(DPL::String(BACKGROUND_ENABLED));
- if(!bgEnableValue.IsNull() && !bgEnableValue->compare(L"true")) {
+ if (!bgEnableValue.IsNull() && !bgEnableValue->compare(L"true")) {
//skip suspendWidget
LogDebug("Background support enabled, set process active");
pid_t pid = getpid();
@@ -554,7 +564,7 @@ void ViewLogic::initializeSupport()
ewk_context_memory_saving_mode_set(
m_ewkContext,
static_cast(result) ==
- WrtDB::SETTINGS_TYPE_ON ? EINA_TRUE : EINA_FALSE);
+ WrtDB::SETTINGS_TYPE_ON ? EINA_TRUE : EINA_FALSE);
m_schemeSupport.reset(new SchemeSupport(m_model->Type.Get().appType));
ViewModule::StorageSupport::initializeStorage(m_model);
m_appsSupport->initialize(m_model);
@@ -575,7 +585,8 @@ void ViewLogic::initializePluginLoading()
m_model->SettingList.Get().isEncrypted());
}
-void ViewLogic::ewkClientInit(Evas_Object *wkView) {
+void ViewLogic::ewkClientInit(Evas_Object *wkView)
+{
Assert(NULL != wkView && "ewk_view not created at this point");
FOREACH(it, m_ewkCallbacksMap) {
@@ -592,7 +603,8 @@ void ViewLogic::ewkClientInit(Evas_Object *wkView) {
this);
}
-void ViewLogic::ewkClientDeinit(Evas_Object *wkView) {
+void ViewLogic::ewkClientDeinit(Evas_Object *wkView)
+{
LogDebug("ewkClientDeinit");
Assert(NULL != wkView && "ewk_view not created at this point");
@@ -614,14 +626,14 @@ bool ViewLogic::createEwkView(Evas* canvas)
Assert(canvas);
ADD_PROFILING_POINT("ewk_view_add_with_context", "start");
Evas_Object* newEwkView = ewk_view_add_with_context(
- canvas,
- m_ewkContext);
+ canvas,
+ m_ewkContext);
ADD_PROFILING_POINT("ewk_view_add_with_context", "stop");
if (!newEwkView) {
LogError("View creation failed");
Wrt::Popup::PopupInvoker().showInfo(
- "Info", "View creation failed","close");
+ "Info", "View creation failed", "close");
return false;
}
@@ -632,7 +644,7 @@ bool ViewLogic::createEwkView(Evas* canvas)
ewkCookieManager =
ewk_context_cookie_manager_get(m_ewkContext);
ewk_cookie_manager_accept_policy_set(ewkCookieManager,
- EWK_COOKIE_ACCEPT_POLICY_ALWAYS);
+ EWK_COOKIE_ACCEPT_POLICY_ALWAYS);
LogInfo("push webview: " << newEwkView);
m_ewkViewList.push_back(newEwkView);
@@ -684,7 +696,8 @@ void ViewLogic::prepareEwkView(Evas_Object *wkView)
// The followings are not implemeted yet by webkit2
// ewk_view_setting_accelerated_compositing_enable_set(EINA_TRUE);
// ewk_view_mode_set();
- // ewk_view_setting_enable_specified_plugin_set(EINA_TRUE, FLASH_MIME_TYPE);
+ // ewk_view_setting_enable_specified_plugin_set(EINA_TRUE,
+ // FLASH_MIME_TYPE);
// ewk_view_setting_html5video_external_player_enable_set(EINA_FALSE);
// ewk_view_show_ime_on_autofocus_set(EINA_TRUE);
// elm_webview_show_magnifier_set(EINA_FALSE);
@@ -807,10 +820,10 @@ void ViewLogic::suspendWebkit(Evas_Object *wkView)
}
void ViewLogic::contextMessageFromInjectedBundleCallback(
- const char* name,
- const char* body,
- char** returnData,
- void* clientInfo)
+ const char* name,
+ const char* body,
+ char** returnData,
+ void* clientInfo)
{
LogDebug("contextMessageFromInjectedBundleCallback called");
Assert(clientInfo);
@@ -831,8 +844,8 @@ void ViewLogic::contextMessageFromInjectedBundleCallback(
}
void ViewLogic::didStartDownloadCallback(
- const char* downloadUrl,
- void* data)
+ const char* downloadUrl,
+ void* data)
{
LogDebug("didStartDownloadCallback called");
Assert(data);
@@ -846,9 +859,9 @@ void ViewLogic::didStartDownloadCallback(
}
void ViewLogic::loadStartedCallback(
- void* data,
- Evas_Object* obj,
- void* /*eventInfo*/)
+ void* data,
+ Evas_Object* obj,
+ void* /*eventInfo*/)
{
LogDebug("loadStartedCallback called");
Assert(data);
@@ -859,13 +872,12 @@ void ViewLogic::loadStartedCallback(
if (!This->m_cbs->loadStart.empty()) {
This->m_cbs->loadStart(obj);
}
-
}
void ViewLogic::loadFinishedCallback(
- void* data,
- Evas_Object* obj,
- void* /*eventInfo*/)
+ void* data,
+ Evas_Object* obj,
+ void* /*eventInfo*/)
{
LogDebug("loadFinishedCallback called");
Assert(data);
@@ -883,11 +895,11 @@ void ViewLogic::loadFinishedCallback(
} else {
std::string jsStr = DPL::ToUTF8String(*jsOptionalString).c_str();
- if(EINA_FALSE == ewk_view_script_execute(
- This->m_currentEwkView,
- jsStr.c_str(),
- didRunJavaScriptCallback,
- This))
+ if (EINA_FALSE == ewk_view_script_execute(
+ This->m_currentEwkView,
+ jsStr.c_str(),
+ didRunJavaScriptCallback,
+ This))
{
LogError("JS for auto fill data failed.");
}
@@ -922,9 +934,9 @@ void ViewLogic::loadFinishedCallback(
}
void ViewLogic::titleChangedCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogDebug("titleChangedCallback called");
Assert(data);
@@ -943,18 +955,18 @@ void ViewLogic::titleChangedCallback(
}
void ViewLogic::loadProgressCallback(
- void* /*data*/,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* /*data*/,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
double* progress = static_cast(eventInfo);
LogDebug("didChangeProgressCallback progress = " << *progress);
}
void ViewLogic::loadProgressFinishedCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* /*eventInfo*/)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* /*eventInfo*/)
{
LogDebug("didFinishProgressCallback");
Assert(data);
@@ -965,14 +977,14 @@ void ViewLogic::loadProgressFinishedCallback(
}
void ViewLogic::processCrashedCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogInfo("processCrashedCallback");
Assert(data);
ViewLogic const * const view =
- static_cast(data);
+ static_cast(data);
if (!view->m_cbs->webCrash.empty()) {
view->m_cbs->webCrash();
}
@@ -983,9 +995,9 @@ void ViewLogic::processCrashedCallback(
}
void ViewLogic::createWindowCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo)
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo)
{
LogDebug("createWindowCallback");
Assert(data);
@@ -1029,9 +1041,9 @@ void ViewLogic::createWindowCallback(
}
void ViewLogic::closeWindowCallback(
- void* data,
- Evas_Object* obj,
- void* /*eventInfo*/)
+ void* data,
+ Evas_Object* obj,
+ void* /*eventInfo*/)
{
LogDebug("closeWindowCallback");
ViewLogic* This = static_cast(data);
@@ -1040,9 +1052,9 @@ void ViewLogic::closeWindowCallback(
}
void ViewLogic::policyNavigationDecideCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogDebug("policyNavigationDecideCallback called");
Assert(data);
@@ -1062,7 +1074,7 @@ void ViewLogic::policyNavigationDecideCallback(
} else {
// check whether this is new empty window
const char* activeUrl = ewk_view_url_get(This->m_currentEwkView);
- if(!activeUrl || 0 == strlen(activeUrl)) {
+ if (!activeUrl || 0 == strlen(activeUrl)) {
/*
* The view is empty and scheme has been handled externally. When
* user gets back from the external application he'd see blank page
@@ -1091,9 +1103,9 @@ void ViewLogic::policyNavigationDecideCallback(
}
void ViewLogic::policyNewWindowDecideCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogDebug("policyNewWindowDecideCallback called");
Assert(data);
@@ -1116,9 +1128,9 @@ void ViewLogic::policyNewWindowDecideCallback(
}
void ViewLogic::pageResponseDecideCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogDebug("pageResponseDecideCallback called");
Assert(data);
@@ -1137,7 +1149,7 @@ void ViewLogic::pageResponseDecideCallback(
ewk_policy_decision_suspend(policyDecision);
// get uri information
- const char* url = ewk_policy_decision_url_get(policyDecision);
+ const char* url = ewk_policy_decision_url_get(policyDecision);
if (NULL == url || strlen(url) == 0) {
LogDebug("url data is empty");
ewk_policy_decision_use(policyDecision);
@@ -1170,9 +1182,9 @@ void ViewLogic::pageResponseDecideCallback(
}
void ViewLogic::contextmenuCustomizeCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogDebug("contextmenuCustomizeCallback called");
Assert(data);
@@ -1181,11 +1193,12 @@ void ViewLogic::contextmenuCustomizeCallback(
Ewk_Context_Menu* menu = static_cast(eventInfo);
if ((This->m_model->Type.Get().appType == WrtDB::APP_TYPE_TIZENWEBAPP) &&
(This->m_model->SettingList.Get().getContextMenu()
- == ContextMenu_Disable))
+ == ContextMenu_Disable))
{
LogDebug("ContextMenu Disable!!");
for (unsigned int idx = 0; idx < ewk_context_menu_item_count(menu);) {
- Ewk_Context_Menu_Item* item = ewk_context_menu_nth_item_get(menu, idx);
+ Ewk_Context_Menu_Item* item = ewk_context_menu_nth_item_get(menu,
+ idx);
Assert(item);
ewk_context_menu_item_remove(menu, item);
}
@@ -1194,7 +1207,8 @@ void ViewLogic::contextmenuCustomizeCallback(
int menu_num = ewk_context_menu_item_count(menu);
unsigned int idx = 0;
do {
- Ewk_Context_Menu_Item* item = ewk_context_menu_nth_item_get(menu, idx);
+ Ewk_Context_Menu_Item* item = ewk_context_menu_nth_item_get(menu,
+ idx);
if (!item) {
idx++;
continue;
@@ -1202,38 +1216,38 @@ void ViewLogic::contextmenuCustomizeCallback(
Ewk_Context_Menu_Item_Tag tag = ewk_context_menu_item_tag_get(item);
switch (tag) {
- case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW:
- ewk_context_menu_item_remove(menu, item);
- continue;
+ case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW:
+ ewk_context_menu_item_remove(menu, item);
+ continue;
- case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW:
- ewk_context_menu_item_remove(menu, item);
- continue;
+ case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW:
+ ewk_context_menu_item_remove(menu, item);
+ continue;
- case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_FRAME_IN_NEW_WINDOW:
- ewk_context_menu_item_remove(menu, item);
- continue;
+ case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_FRAME_IN_NEW_WINDOW:
+ ewk_context_menu_item_remove(menu, item);
+ continue;
- case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_MEDIA_IN_NEW_WINDOW:
- ewk_context_menu_item_remove(menu, item);
- continue;
+ case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_MEDIA_IN_NEW_WINDOW:
+ ewk_context_menu_item_remove(menu, item);
+ continue;
- case EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB:
- ewk_context_menu_item_remove(menu, item);
- continue;
+ case EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB:
+ ewk_context_menu_item_remove(menu, item);
+ continue;
- default:
- idx++;
- break;
+ default:
+ idx++;
+ break;
}
} while (idx < menu_num);
}
}
void ViewLogic::formSubmitCallback(
- void* /*data*/,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* /*data*/,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogDebug("formSubmitCallback called");
Assert(eventInfo);
@@ -1250,18 +1264,18 @@ void ViewLogic::formSubmitCallback(
}
void ViewLogic::geolocationPermissionRequestCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
Assert(data);
ViewLogic* This = static_cast(data);
Assert(eventInfo);
Ewk_Geolocation_Permission_Data* permissionRequest =
- static_cast(eventInfo);
+ static_cast(eventInfo);
if (This->m_securityOriginSupport->isNeedPermissionCheck(
- SecurityOriginDB::FEATURE_GEOLOCATION)
+ SecurityOriginDB::FEATURE_GEOLOCATION)
== WrtDB::SETTINGS_TYPE_OFF)
{
ewk_geolocation_permission_request_allow_set(
@@ -1276,9 +1290,9 @@ void ViewLogic::geolocationPermissionRequestCallback(
}
void ViewLogic::notificationShowCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogDebug("notificationShowCallback called");
Assert(data);
@@ -1290,9 +1304,9 @@ void ViewLogic::notificationShowCallback(
using namespace ViewModule::WebNotification;
WebNotificationDataPtr notiData(
- new WebNotificationData(
- This->m_model,
- ewk_notification_id_get(noti)));
+ new WebNotificationData(
+ This->m_model,
+ ewk_notification_id_get(noti)));
DPL::OptionalString string =
DPL::FromUTF8String(ewk_notification_icon_url_get(noti));
@@ -1318,23 +1332,23 @@ void ViewLogic::notificationShowCallback(
}
void ViewLogic::notificationCancelCallback(
- void* /*data*/,
- Evas_Object* /*obj*/,
- void* /*eventInfo*/)
+ void* /*data*/,
+ Evas_Object* /*obj*/,
+ void* /*eventInfo*/)
{
LogDebug("notificationCancelCallback called");
}
void ViewLogic::notificationPermissionRequestCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogDebug("notificationPermissionRequestCallback called");
Assert(data);
ViewLogic* This = static_cast(data);
if (This->m_securityOriginSupport->isNeedPermissionCheck(
- SecurityOriginDB::FEATURE_WEB_NOTIFICATION)
+ SecurityOriginDB::FEATURE_WEB_NOTIFICATION)
== WrtDB::SETTINGS_TYPE_OFF)
{
Ewk_Notification_Permission_Request* request =
@@ -1377,10 +1391,10 @@ void ViewLogic::vibrationCancelCallback(void* data)
// EWK Orientation Callback
Eina_Bool ViewLogic::orientationLockCallback(
- Evas_Object* obj,
- Eina_Bool /*needLock*/,
- int orientation,
- void* data)
+ Evas_Object* obj,
+ Eina_Bool /*needLock*/,
+ int orientation,
+ void* data)
{
LogDebug("orientationLockCallback called");
Assert(data);
@@ -1390,15 +1404,15 @@ Eina_Bool ViewLogic::orientationLockCallback(
LogDebug("orientation is portrait-primary");
elm_win_rotation_with_resize_set(This->m_window, 0);
ewk_view_orientation_send(obj, 0);
- } else if(orientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_PRIMARY) {
+ } else if (orientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_PRIMARY) {
LogDebug("orientation is landscape-primary");
elm_win_rotation_with_resize_set(This->m_window, 270);
ewk_view_orientation_send(obj, 90);
- } else if(orientation & EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY) {
+ } else if (orientation & EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY) {
LogDebug("orientation is portrait-secondary");
elm_win_rotation_with_resize_set(This->m_window, 180);
ewk_view_orientation_send(obj, 180);
- } else if(orientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_SECONDARY) {
+ } else if (orientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_SECONDARY) {
LogDebug("orientation is landscape-secondary");
elm_win_rotation_with_resize_set(This->m_window, 90);
ewk_view_orientation_send(obj, -90);
@@ -1409,12 +1423,11 @@ Eina_Bool ViewLogic::orientationLockCallback(
return EINA_TRUE;
}
-
// Fullscreen API callbacks
void ViewLogic::enterFullscreenCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* /*eventInfo*/)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* /*eventInfo*/)
{
LogInfo("enterFullscreenCallback called");
Assert(data);
@@ -1424,9 +1437,9 @@ void ViewLogic::enterFullscreenCallback(
}
}
void ViewLogic::exitFullscreenCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* /*eventInfo*/)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* /*eventInfo*/)
{
LogInfo("exitFullscreenCallback called");
Assert(data);
@@ -1437,9 +1450,9 @@ void ViewLogic::exitFullscreenCallback(
}
void ViewLogic::imeChangedCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogDebug("enter");
Assert(data);
@@ -1451,9 +1464,9 @@ void ViewLogic::imeChangedCallback(
}
void ViewLogic::imeOpenedCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* /*eventInfo*/)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* /*eventInfo*/)
{
LogDebug("enter");
Assert(data);
@@ -1465,14 +1478,14 @@ void ViewLogic::imeOpenedCallback(
args.width = This->m_imeWidth;
args.height = This->m_imeHeight;
This->fireJavascriptEvent(
- static_cast(SoftKeyboardChangeCustomEvent),
- &args);
+ static_cast(SoftKeyboardChangeCustomEvent),
+ &args);
}
void ViewLogic::imeClosedCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* /*eventInfo*/)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* /*eventInfo*/)
{
LogDebug("enter");
Assert(data);
@@ -1483,14 +1496,14 @@ void ViewLogic::imeClosedCallback(
args.state = IME_STATE_OFF;
This->fireJavascriptEvent(
- static_cast(SoftKeyboardChangeCustomEvent),
- &args);
+ static_cast(SoftKeyboardChangeCustomEvent),
+ &args);
}
void ViewLogic::usermediaPermissionRequestCallback(
- void* data,
- Evas_Object* /*obj*/,
- void* eventInfo)
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
{
LogDebug("usermediaPermissionRequestCallback called");
Assert(data);
@@ -1499,14 +1512,14 @@ void ViewLogic::usermediaPermissionRequestCallback(
eventInfo);
}
-
// helper method
CustomHandlerDB::CustomHandlerPtr getCustomHandlerFromData(void* data)
{
Assert(data);
Ewk_Custom_Handlers_Data* handler =
- static_cast(data);
- CustomHandlerDB::CustomHandlerPtr customHandler(new CustomHandlerDB::CustomHandler());
+ static_cast(data);
+ CustomHandlerDB::CustomHandlerPtr customHandler(
+ new CustomHandlerDB::CustomHandler());
const char* base_url = ewk_custom_handlers_data_base_url_get(handler);
if (base_url) {
LogDebug("base url: " << base_url);
@@ -1588,27 +1601,29 @@ char const * const contentBlackList[contentBlackListLenth] = {
* @param customHandler
*/
void saveUserResponse(Wrt::Popup::PopupResponse response,
- CustomHandlerDB::CustomHandlerPtr customHandler)
+ CustomHandlerDB::CustomHandlerPtr customHandler)
{
switch (response) {
- case Wrt::Popup::YES_DO_REMEMBER:
- LogDebug("User allowed, remember");
- customHandler->user_decision = static_cast
- (CustomHandlerDB::Agreed | CustomHandlerDB::DecisionSaved);
- break;
- case Wrt::Popup::YES_DONT_REMEMBER:
- LogDebug("User allowed, don't remember");
- customHandler->user_decision = CustomHandlerDB::Agreed;
- break;
- case Wrt::Popup::NO_DO_REMEMBER:
- LogDebug("User didn't allow, remember");
- customHandler->user_decision = static_cast
- (CustomHandlerDB::Declined | CustomHandlerDB::DecisionSaved);
- break;
- case Wrt::Popup::NO_DONT_REMEMBER:
- LogDebug("User didn't allow, don't remember");
- customHandler->user_decision = CustomHandlerDB::Declined;
- break;
+ case Wrt::Popup::YES_DO_REMEMBER:
+ LogDebug("User allowed, remember");
+ customHandler->user_decision =
+ static_cast
+ (CustomHandlerDB::Agreed | CustomHandlerDB::DecisionSaved);
+ break;
+ case Wrt::Popup::YES_DONT_REMEMBER:
+ LogDebug("User allowed, don't remember");
+ customHandler->user_decision = CustomHandlerDB::Agreed;
+ break;
+ case Wrt::Popup::NO_DO_REMEMBER:
+ LogDebug("User didn't allow, remember");
+ customHandler->user_decision =
+ static_cast
+ (CustomHandlerDB::Declined | CustomHandlerDB::DecisionSaved);
+ break;
+ case Wrt::Popup::NO_DONT_REMEMBER:
+ LogDebug("User didn't allow, don't remember");
+ customHandler->user_decision = CustomHandlerDB::Declined;
+ break;
}
}
@@ -1623,7 +1638,7 @@ void ViewLogic::protocolHandlerRegistrationCallback(void* data,
Assert(data);
LogDebug("enter");
CustomHandlerDB::CustomHandlerPtr customHandler =
- getCustomHandlerFromData(eventInfo);
+ getCustomHandlerFromData(eventInfo);
std::string scheme = DPL::ToUTF8String(customHandler->target);
if (scheme.empty()) {
@@ -1634,8 +1649,7 @@ void ViewLogic::protocolHandlerRegistrationCallback(void* data,
bool matched = false;
//scheme on whiteList
for (int i = 0; i < protocolWhiteListLenth; ++i) {
- if (0 == strcmp(protocolWhiteList[i], scheme.c_str()))
- {
+ if (0 == strcmp(protocolWhiteList[i], scheme.c_str())) {
LogDebug("Match found, protocol can be handled");
matched = true;
}
@@ -1649,8 +1663,7 @@ void ViewLogic::protocolHandlerRegistrationCallback(void* data,
}
int l = 4;
char c = scheme[l];
- while (c != '\0')
- {
+ while (c != '\0') {
if (c < 'a' || c > 'z') {
LogWarning("Wrong char inside scheme. "
<< "Only lowercase ASCII letters accepted");
@@ -1666,32 +1679,35 @@ void ViewLogic::protocolHandlerRegistrationCallback(void* data,
This->attachToCustomHandlersDao();
CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
CustomHandlerDB::CustomHandlerPtr handler =
- handlersDao.getProtocolHandler(customHandler->target,
- customHandler->url,
- customHandler->base_url);
+ handlersDao.getProtocolHandler(customHandler->target,
+ customHandler->url,
+ customHandler->base_url);
if (handler && (handler->user_decision & CustomHandlerDB::DecisionSaved)) {
LogDebug("Protocol already registered - nothing to do");
} else {
LogDebug("Protocol handler not found");
Wrt::Popup::PopupResponse response =
- GlobalSettings::PopupsTestModeEnabled() ? Wrt::Popup::YES_DO_REMEMBER :
- Wrt::Popup::PopupInvoker().askYesNoCheckbox(
- PROTOCOL_HANDLER_ASK_TITLE,
- PROTOCOL_HANDLER_ASK_MSG,
- PROTOCOL_HANDLER_ASK_REMEMBER);
+ GlobalSettings::PopupsTestModeEnabled() ? Wrt::Popup::
+ YES_DO_REMEMBER :
+ Wrt::Popup::PopupInvoker().askYesNoCheckbox(
+ PROTOCOL_HANDLER_ASK_TITLE,
+ PROTOCOL_HANDLER_ASK_MSG,
+ PROTOCOL_HANDLER_ASK_REMEMBER);
saveUserResponse(response, customHandler);
- if (customHandler->user_decision == CustomHandlerDB::Declined)
+ if (customHandler->user_decision == CustomHandlerDB::Declined) {
return;
+ }
handlersDao.registerProtocolHandler(*(customHandler.get()));
if (customHandler->user_decision & CustomHandlerDB::Agreed) {
//TODO remove old default handler somehow from appsvc
LogDebug("Registering appservice entry");
int ret = appsvc_set_defapp(APPSVC_OPERATION_VIEW,
- NULL,
- DPL::ToUTF8String(customHandler->target).c_str(),
- DPL::ToUTF8String(This->m_model->TizenId).c_str());
- if (APPSVC_RET_OK != ret)
- {
+ NULL,
+ DPL::ToUTF8String(
+ customHandler->target).c_str(),
+ DPL::ToUTF8String(This->m_model->
+ TizenId).c_str());
+ if (APPSVC_RET_OK != ret) {
LogWarning("Appsvc entry failed: " << ret);
}
}
@@ -1706,28 +1722,31 @@ void ViewLogic::protocolHandlerIsRegisteredCallback(void* data,
void* eventInfo)
{
LogDebug("enter");
- CustomHandlerDB::CustomHandlerPtr customHandler = getCustomHandlerFromData(eventInfo);
+ CustomHandlerDB::CustomHandlerPtr customHandler = getCustomHandlerFromData(
+ eventInfo);
ViewLogic* This = static_cast(data);
LogDebug("Creating handlers dao");
This->attachToCustomHandlersDao();
CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
- CustomHandlerDB::CustomHandlerPtr handler =
- handlersDao.getProtocolHandler(customHandler->target,
- customHandler->url,
- customHandler->base_url);
+ CustomHandlerDB::CustomHandlerPtr handler =
+ handlersDao.getProtocolHandler(customHandler->target,
+ customHandler->url,
+ customHandler->base_url);
if (handler) {
- if (handler->user_decision & CustomHandlerDB::Agreed)
+ if (handler->user_decision & CustomHandlerDB::Agreed) {
ewk_custom_handlers_data_result_set(
static_cast(data),
EWK_CUSTOM_HANDLERS_REGISTERED);
- else
+ } else {
ewk_custom_handlers_data_result_set(
static_cast(data),
EWK_CUSTOM_HANDLERS_DECLINED);
- } else
- ewk_custom_handlers_data_result_set(
- static_cast(data),
- EWK_CUSTOM_HANDLERS_NEW);
+ }
+ } else {
+ ewk_custom_handlers_data_result_set(
+ static_cast(data),
+ EWK_CUSTOM_HANDLERS_NEW);
+ }
This->detachFromCustomHandlersDao();
}
@@ -1737,7 +1756,7 @@ void ViewLogic::protocolHandlerUnregistrationCallback(void* data,
{
LogDebug("enter");
CustomHandlerDB::CustomHandlerPtr customHandler =
- getCustomHandlerFromData(eventInfo);
+ getCustomHandlerFromData(eventInfo);
ViewLogic* This = static_cast(data);
LogDebug("Creating handlers dao");
This->attachToCustomHandlersDao();
@@ -1747,14 +1766,16 @@ void ViewLogic::protocolHandlerUnregistrationCallback(void* data,
customHandler->url,
customHandler->base_url);
if (handlerCheck) {
- if (handlerCheck->user_decision & CustomHandlerDB::Agreed)
+ if (handlerCheck->user_decision & CustomHandlerDB::Agreed) {
appsvc_unset_defapp(DPL::ToUTF8String(This->m_model->TizenId).c_str());
+ }
handlersDao.unregisterProtocolHandler(customHandler->target,
customHandler->url,
customHandler->base_url);
- } else
+ } else {
LogDebug("Nothing to unregister");
+ }
This->detachFromCustomHandlersDao();
}
@@ -1766,17 +1787,15 @@ void ViewLogic::contentHandlerRegistrationCallback(void* data,
Assert(data);
LogDebug("enter");
CustomHandlerDB::CustomHandlerPtr customHandler =
- getCustomHandlerFromData(eventInfo);
+ getCustomHandlerFromData(eventInfo);
std::string mimeType = DPL::ToUTF8String(customHandler->target);
if (mimeType.empty()) {
LogError("No mimeType provided.");
return;
}
- for (int i = 0; i < contentBlackListLenth; ++i)
- {
- if (0 == strcmp(contentBlackList[i], mimeType.c_str()))
- {
+ for (int i = 0; i < contentBlackListLenth; ++i) {
+ if (0 == strcmp(contentBlackList[i], mimeType.c_str())) {
LogWarning("mimeType blacklisted");
//throw SecurityException
return;
@@ -1787,33 +1806,36 @@ void ViewLogic::contentHandlerRegistrationCallback(void* data,
LogDebug("Creating handlers dao");
This->attachToCustomHandlersDao();
CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
- CustomHandlerDB::CustomHandlerPtr handler =
- handlersDao.getContentHandler(customHandler->target,
- customHandler->url,
- customHandler->base_url);
+ CustomHandlerDB::CustomHandlerPtr handler =
+ handlersDao.getContentHandler(customHandler->target,
+ customHandler->url,
+ customHandler->base_url);
if (handler && (handler->user_decision & CustomHandlerDB::DecisionSaved)) {
LogDebug("Protocol already registered - nothing to do");
} else {
LogDebug("Protocol handler not found");
Wrt::Popup::PopupResponse response =
- GlobalSettings::PopupsTestModeEnabled() ? Wrt::Popup::YES_DO_REMEMBER :
- Wrt::Popup::PopupInvoker().askYesNoCheckbox(
- CONTENT_HANDLER_ASK_TITLE,
- CONTENT_HANDLER_ASK_MSG,
- CONTENT_HANDLER_AKS_REMEMBER);
+ GlobalSettings::PopupsTestModeEnabled() ? Wrt::Popup::
+ YES_DO_REMEMBER :
+ Wrt::Popup::PopupInvoker().askYesNoCheckbox(
+ CONTENT_HANDLER_ASK_TITLE,
+ CONTENT_HANDLER_ASK_MSG,
+ CONTENT_HANDLER_AKS_REMEMBER);
saveUserResponse(response, customHandler);
- if (customHandler->user_decision == CustomHandlerDB::Declined)
+ if (customHandler->user_decision == CustomHandlerDB::Declined) {
return;
+ }
handlersDao.registerContentHandler(*(customHandler.get()));
if (customHandler->user_decision & CustomHandlerDB::Agreed) {
//TODO remove old default handler somehow from appsvc
LogDebug("Registering appservice entry");
int ret = appsvc_set_defapp(APPSVC_OPERATION_VIEW,
- DPL::ToUTF8String(customHandler->target).c_str(),
- NULL,
- DPL::ToUTF8String(This->m_model->TizenId).c_str());
- if (APPSVC_RET_OK != ret)
- {
+ DPL::ToUTF8String(
+ customHandler->target).c_str(),
+ NULL,
+ DPL::ToUTF8String(This->m_model->
+ TizenId).c_str());
+ if (APPSVC_RET_OK != ret) {
LogWarning("Appsvc entry failed: " << ret);
}
}
@@ -1834,23 +1856,25 @@ void ViewLogic::contentHandlerIsRegisteredCallback(void* data,
This->attachToCustomHandlersDao();
CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
- CustomHandlerDB::CustomHandlerPtr handler =
- handlersDao.getContentHandler(customHandler->target,
- customHandler->url,
- customHandler->base_url);
+ CustomHandlerDB::CustomHandlerPtr handler =
+ handlersDao.getContentHandler(customHandler->target,
+ customHandler->url,
+ customHandler->base_url);
if (handler) {
- if (handler->user_decision & CustomHandlerDB::Agreed)
+ if (handler->user_decision & CustomHandlerDB::Agreed) {
ewk_custom_handlers_data_result_set(
static_cast(data),
EWK_CUSTOM_HANDLERS_REGISTERED);
- else
+ } else {
ewk_custom_handlers_data_result_set(
static_cast(data),
EWK_CUSTOM_HANDLERS_DECLINED);
- } else
- ewk_custom_handlers_data_result_set(
- static_cast(data),
- EWK_CUSTOM_HANDLERS_NEW);
+ }
+ } else {
+ ewk_custom_handlers_data_result_set(
+ static_cast(data),
+ EWK_CUSTOM_HANDLERS_NEW);
+ }
This->detachFromCustomHandlersDao();
}
@@ -1860,31 +1884,33 @@ void ViewLogic::contentHandlerUnregistrationCallback(void* data,
{
LogDebug("enter");
CustomHandlerDB::CustomHandlerPtr customHandler =
- getCustomHandlerFromData(eventInfo);
+ getCustomHandlerFromData(eventInfo);
ViewLogic* This = static_cast(data);
LogDebug("Creating handlers dao");
This->attachToCustomHandlersDao();
CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
- CustomHandlerDB::CustomHandlerPtr handlerCheck =
- handlersDao.getContentHandler(customHandler->target,
- customHandler->url,
- customHandler->base_url);
- if (handlerCheck) {
- if (handlerCheck->user_decision & CustomHandlerDB::Agreed)
- appsvc_unset_defapp(DPL::ToUTF8String(This->m_model->TizenId).c_str());
-
- handlersDao.unregisterContentHandler(customHandler->target,
- customHandler->url,
- customHandler->base_url);
- } else
- LogDebug("Nothing to unregister");
+ CustomHandlerDB::CustomHandlerPtr handlerCheck =
+ handlersDao.getContentHandler(customHandler->target,
+ customHandler->url,
+ customHandler->base_url);
+ if (handlerCheck) {
+ if (handlerCheck->user_decision & CustomHandlerDB::Agreed) {
+ appsvc_unset_defapp(DPL::ToUTF8String(This->m_model->TizenId).c_str());
+ }
+
+ handlersDao.unregisterContentHandler(customHandler->target,
+ customHandler->url,
+ customHandler->base_url);
+ } else {
+ LogDebug("Nothing to unregister");
+ }
This->detachFromCustomHandlersDao();
}
void ViewLogic::didRunJavaScriptCallback(
- Evas_Object* /*obj*/,
- const char* result,
- void* /*userData*/)
+ Evas_Object* /*obj*/,
+ const char* result,
+ void* /*userData*/)
{
LogInfo("didRunJavaScriptCallback called");
LogInfo("result = " << result);
@@ -1927,7 +1953,7 @@ void ViewLogic::databaseUsagePermissionRequestCallback(
Assert(eventInfo);
if (This->m_securityOriginSupport->isNeedPermissionCheck(
- SecurityOriginDB::FEATURE_WEB_DATABASE)
+ SecurityOriginDB::FEATURE_WEB_DATABASE)
== WrtDB::SETTINGS_TYPE_OFF)
{
// default value is deny
@@ -1938,7 +1964,7 @@ void ViewLogic::databaseUsagePermissionRequestCallback(
This->m_securityOriginSupport->getSecurityOriginDAO(),
eventInfo);
return;
- }
+}
void ViewLogic::fileSystemPermissionRequestCallback(
void* data,
@@ -1950,11 +1976,11 @@ void ViewLogic::fileSystemPermissionRequestCallback(
ViewLogic* This = static_cast(data);
if (This->m_securityOriginSupport->isNeedPermissionCheck(
- SecurityOriginDB::FEATURE_FILE_SYSTEM_ACCESS)
+ SecurityOriginDB::FEATURE_FILE_SYSTEM_ACCESS)
== WrtDB::SETTINGS_TYPE_OFF)
{
Ewk_Context_File_System_Permission* fileSystemPermission =
- static_cast(eventInfo);
+ static_cast(eventInfo);
ewk_context_file_system_permission_allow_set(fileSystemPermission,
EINA_FALSE);
return;
@@ -1977,16 +2003,15 @@ void ViewLogic::certificateConfirmRequestCallback(
Assert(data);
ViewLogic* This = static_cast(data);
Assert(eventInfo);
- Ewk_Certificate_Policy_Decision* certificatePolicyDecision =
+ Ewk_Certificate_Policy_Decision* certificatePolicyDecision =
static_cast(eventInfo);
bool status = This->askUserForCertificateConfirm();
- if(!status) {
+ if (!status) {
ewk_certificate_policy_decision_allowed_set(
certificatePolicyDecision,
EINA_FALSE);
- }
- else {
+ } else {
ewk_certificate_policy_decision_allowed_set(
certificatePolicyDecision,
EINA_TRUE);
@@ -1996,21 +2021,21 @@ void ViewLogic::certificateConfirmRequestCallback(
bool ViewLogic::askUserForCertificateConfirm()
{
return Wrt::Popup::PopupInvoker().askYesNo(
- CERTIFICATE_CONFIRM_REQUEST_ASK_TITLE,
- CERTIFICATE_CONFIRM_REQUEST_ASK_BODY);
+ CERTIFICATE_CONFIRM_REQUEST_ASK_TITLE,
+ CERTIFICATE_CONFIRM_REQUEST_ASK_BODY);
}
void ViewLogic::didRecieveMessageFromInjectedBundle(
- const char* name,
- const char* /*body*/)
+ const char* name,
+ const char* /*body*/)
{
LogDebug("did recive message " << name);
}
void ViewLogic::didReceiveSynchronousMessage(
- const char* name,
- const char* body,
- char** returnData)
+ const char* name,
+ const char* body,
+ char** returnData)
{
LogDebug("didReceiveSynchronousMessage called");
Assert(name);
@@ -2032,7 +2057,7 @@ void ViewLogic::didReceiveSynchronousMessage(
} else if (!strcmp(name, uriChangedMessageName)) {
LogDebug("received : " << uriChangedMessageName);
std::string ret = requestUriChanged(DPL::FromUTF8String(body));
- *returnData = strdup(ret.c_str());
+ *returnData = strdup(ret.c_str());
}
}
@@ -2054,10 +2079,8 @@ std::string ViewLogic::requestUriChanged(const DPL::String& changedURL)
// If url is same to URICHANGE_BLOCKED_URL,
// this url has been already blocked by willsend.
// So current page should be moved to previous page
- if (url == URICHANGE_BLOCKED_URL)
- {
- if (m_model->Type.Get().appType == WrtDB::APP_TYPE_TIZENWEBAPP)
- {
+ if (url == URICHANGE_BLOCKED_URL) {
+ if (m_model->Type.Get().appType == WrtDB::APP_TYPE_TIZENWEBAPP) {
// block this page and open it in browser
LogDebug("Request was blocked by WARP: " << url.c_str());
if (!m_blockedUri.empty()) {
@@ -2150,7 +2173,7 @@ void ViewLogic::windowClose()
// resume ewkView
/* In case we support many pages in parallel
- then view is not suspended*/
+ * then view is not suspended*/
//resumeEwkView(m_currentEwkView);
// show ewkView
diff --git a/src/view/webkit/view_logic.h b/src/view/webkit/view_logic.h
old mode 100755
new mode 100644
index 753a828..b7006c1
--- a/src/view/webkit/view_logic.h
+++ b/src/view/webkit/view_logic.h
@@ -88,97 +88,97 @@ class ViewLogic : public ViewModule::IViewModule
// message from injected bundle Callback
static void contextMessageFromInjectedBundleCallback(
- const char* name,
- const char* body,
- char** returnData,
- void* userData);
+ const char* name,
+ const char* body,
+ char** returnData,
+ void* userData);
// EWK Context Callback
static void didStartDownloadCallback(
- const char* downloadUrl,
- void* data);
+ const char* downloadUrl,
+ void* data);
// WKPageLoaderClient
static void loadStartedCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void loadFinishedCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void titleChangedCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void loadProgressCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void loadProgressFinishedCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void processCrashedCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
// EWK Callback
static void createWindowCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void closeWindowCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
// EWK PolicyDecide Callback
static void policyNavigationDecideCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void policyNewWindowDecideCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void pageResponseDecideCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
// EWK ContextMenu Callback
static void contextmenuCustomizeCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
// EWK FormClient Callback
static void formSubmitCallback(
- void *data,
- Evas_Object *obj,
- void *eventInfo);
+ void *data,
+ Evas_Object *obj,
+ void *eventInfo);
// EWK Geolocation Callback
static void geolocationPermissionRequestCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
// EWK Notification Callback
static void notificationShowCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void notificationCancelCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void notificationPermissionRequestCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
// EWK Vibration Callback
static void vibrationVibrateCallback(uint64_t time, void* data);
@@ -186,61 +186,61 @@ class ViewLogic : public ViewModule::IViewModule
// EWK Orientation Callback
static Eina_Bool orientationLockCallback(
- Evas_Object* obj,
- Eina_Bool needLock,
- int orientation,
- void* data);
+ Evas_Object* obj,
+ Eina_Bool needLock,
+ int orientation,
+ void* data);
// EWK Fullscreen API callbacks
static void enterFullscreenCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void exitFullscreenCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
// EWK IME Change/Show/Hide Callback
static void imeChangedCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void imeOpenedCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void imeClosedCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
// EWK Usermedia Callback
static void usermediaPermissionRequestCallback(
- void* data,
- Evas_Object* obj,
- void* eventInfo);
+ void* data,
+ Evas_Object* obj,
+ void* eventInfo);
// custom content/scheme handlers
static void protocolHandlerRegistrationCallback(void* data,
- Evas_Object* obj,
- void* eventInfo);
+ Evas_Object* obj,
+ void* eventInfo);
static void protocolHandlerIsRegisteredCallback(void* data,
- Evas_Object* obj,
- void* eventInfo);
+ Evas_Object* obj,
+ void* eventInfo);
static void protocolHandlerUnregistrationCallback(void* data,
- Evas_Object* obj,
- void* eventInfo);
+ Evas_Object* obj,
+ void* eventInfo);
static void contentHandlerRegistrationCallback(void* data,
- Evas_Object* obj,
- void* eventInfo);
+ Evas_Object* obj,
+ void* eventInfo);
static void contentHandlerIsRegisteredCallback(void* data,
- Evas_Object* obj,
- void* eventInfo);
+ Evas_Object* obj,
+ void* eventInfo);
static void contentHandlerUnregistrationCallback(void* data,
- Evas_Object* obj,
- void* eventInfo);
+ Evas_Object* obj,
+ void* eventInfo);
// database usage permission request callback
static void databaseUsagePermissionRequestCallback(
@@ -263,9 +263,9 @@ class ViewLogic : public ViewModule::IViewModule
// JS execute callback
static void didRunJavaScriptCallback(
- Evas_Object* obj,
- const char* result,
- void* userData);
+ Evas_Object* obj,
+ const char* result,
+ void* userData);
// idler callback
static Eina_Bool windowCloseIdlerCallback(void *data);
@@ -275,12 +275,12 @@ class ViewLogic : public ViewModule::IViewModule
//bundle
void didRecieveMessageFromInjectedBundle(
- const char* name,
- const char* body);
+ const char* name,
+ const char* body);
void didReceiveSynchronousMessage(
- const char* name,
- const char* body,
- char** returnData);
+ const char* name,
+ const char* body,
+ char** returnData);
// security
void rememberBlockedURI(const DPL::String& str);
diff --git a/src/view/webkit/view_logic_filesystem_support.cpp b/src/view/webkit/view_logic_filesystem_support.cpp
index 55e9949..cbea174 100644
--- a/src/view/webkit/view_logic_filesystem_support.cpp
+++ b/src/view/webkit/view_logic_filesystem_support.cpp
@@ -30,7 +30,6 @@
#include
namespace ViewModule {
-
using namespace SecurityOriginDB;
using namespace ViewModule::SecurityOriginSupportUtil;
@@ -74,17 +73,18 @@ void popupCallback(void* data, Evas_Object* obj, void* /*eventInfo*/)
Assert(data);
PermissionData* permData = static_cast(data);
Ewk_Context_File_System_Permission* fileSystemPermission =
- static_cast(permData->m_data);
+ static_cast(permData->m_data);
Evas_Object* popup = getPopup(obj);
Result result = getResult(obj);
if (result != RESULT_UNKNOWN) {
- permData->m_originDao->setSecurityOriginData(permData->m_originData, result);
+ permData->m_originDao->setSecurityOriginData(permData->m_originData,
+ result);
}
Eina_Bool ret =
(result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) ?
- EINA_TRUE : EINA_FALSE;
+ EINA_TRUE : EINA_FALSE;
ewk_context_file_system_permission_allow_set(fileSystemPermission,
ret);
delete permData;
@@ -105,7 +105,7 @@ void FileSystemSupport::fileSystemPermissionRequest(
static_cast(data);
Ewk_Security_Origin* ewkOrigin =
ewk_context_file_system_permission_origin_get(
- fileSystemPermission);
+ fileSystemPermission);
Assert(ewkOrigin);
SecurityOriginData securityOriginData(
diff --git a/src/view/webkit/view_logic_filesystem_support.h b/src/view/webkit/view_logic_filesystem_support.h
index e0f24eb..7465f03 100644
--- a/src/view/webkit/view_logic_filesystem_support.h
+++ b/src/view/webkit/view_logic_filesystem_support.h
@@ -25,17 +25,15 @@
#include
namespace SecurityOriginDB {
- class SecurityOriginDAO;
+class SecurityOriginDAO;
}
namespace ViewModule {
namespace FileSystemSupport {
-
void fileSystemPermissionRequest(
- Evas_Object* window,
- SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
- void* data);
-
+ Evas_Object* window,
+ SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
+ void* data);
} // namespace FileSystemSupport
} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_geolocation_support_webkit2.cpp b/src/view/webkit/view_logic_geolocation_support_webkit2.cpp
index 197d658..853ab16 100644
--- a/src/view/webkit/view_logic_geolocation_support_webkit2.cpp
+++ b/src/view/webkit/view_logic_geolocation_support_webkit2.cpp
@@ -33,7 +33,6 @@
namespace ViewModule {
namespace GeolocationSupport {
namespace Webkit2 {
-
using namespace SecurityOriginDB;
using namespace ViewModule::SecurityOriginSupportUtil;
@@ -74,20 +73,21 @@ void popupCallback(void* data, Evas_Object* obj, void* /*eventInfo*/)
Assert(data);
PermissionData* permData = static_cast(data);
Ewk_Geolocation_Permission_Data* permissionRequest =
- static_cast(permData->m_data);
+ static_cast(permData->m_data);
Evas_Object* popup = getPopup(obj);
Result result = getResult(obj);
if (result != RESULT_UNKNOWN) {
- permData->m_originDao->setSecurityOriginData(permData->m_originData, result);
+ permData->m_originDao->setSecurityOriginData(permData->m_originData,
+ result);
}
Eina_Bool ret =
(result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) ?
- EINA_TRUE : EINA_FALSE;
+ EINA_TRUE : EINA_FALSE;
ewk_geolocation_permission_request_allow_set(
- ewk_geolocation_permission_request_get(permissionRequest),
- ret);
+ ewk_geolocation_permission_request_get(permissionRequest),
+ ret);
delete permData;
evas_object_hide(popup);
evas_object_del(popup);
@@ -95,9 +95,9 @@ void popupCallback(void* data, Evas_Object* obj, void* /*eventInfo*/)
} // namespace
void geolocationPermissionRequest(
- Evas_Object* window,
- SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
- void* data)
+ Evas_Object* window,
+ SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
+ void* data)
{
LogDebug("geolocationPermissionRequest called");
Assert(securityOriginDAO);
@@ -141,6 +141,5 @@ void geolocationPermissionRequest(
return;
}
}
-
} // namespace GeolocationSupport
} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_geolocation_support_webkit2.h b/src/view/webkit/view_logic_geolocation_support_webkit2.h
index bbe2600..e1869b6 100644
--- a/src/view/webkit/view_logic_geolocation_support_webkit2.h
+++ b/src/view/webkit/view_logic_geolocation_support_webkit2.h
@@ -25,18 +25,16 @@
#include
namespace SecurityOriginDB {
- class SecurityOriginDAO;
+class SecurityOriginDAO;
}
namespace ViewModule {
namespace GeolocationSupport {
namespace Webkit2 {
-
void geolocationPermissionRequest(
- Evas_Object* window,
- SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
- void* data);
-
+ Evas_Object* window,
+ SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
+ void* data);
}
} // namespace GeolocationSupport
} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_scheme_support.cpp b/src/view/webkit/view_logic_scheme_support.cpp
index 9366fa1..3cef451 100644
--- a/src/view/webkit/view_logic_scheme_support.cpp
+++ b/src/view/webkit/view_logic_scheme_support.cpp
@@ -45,13 +45,13 @@ static Eina_Bool exitAppIdlerCallback(void* /*data*/)
// webapp termination
ewk_shutdown();
elm_exit();
- return ECORE_CALLBACK_CANCEL;}
-
+ return ECORE_CALLBACK_CANCEL;
+}
} // namespace
bool SchemeSupport::HandleUri(
- const char* uri,
- ViewModule::SchemeActionMap::NavigationContext context)
+ const char* uri,
+ ViewModule::SchemeActionMap::NavigationContext context)
{
return ViewModule::SchemeActionMap::HandleUri(uri,
context,
@@ -140,8 +140,7 @@ bool SchemeSupport::filterURIByScheme(Ewk_Policy_Decision* policyDecision,
ewk_frame_is_main_frame(ewk_policy_decision_frame_get(policyDecision));
using namespace ViewModule::SchemeActionMap;
- if (HandleTizenScheme(url, window, wkView))
- {
+ if (HandleTizenScheme(url, window, wkView)) {
LogDebug("Scheme is tizen scheme");
return false;
}
diff --git a/src/view/webkit/view_logic_scheme_support.h b/src/view/webkit/view_logic_scheme_support.h
index 0072c0b..73a9560 100644
--- a/src/view/webkit/view_logic_scheme_support.h
+++ b/src/view/webkit/view_logic_scheme_support.h
@@ -30,7 +30,8 @@
class WindowData;
class WidgetModel;
-class SchemeSupport {
+class SchemeSupport
+{
public:
explicit SchemeSupport(WrtDB::AppType type) : m_type(type) {}
bool HandleTizenScheme(const char* uri,
@@ -44,6 +45,7 @@ class SchemeSupport {
WidgetModel* model,
Evas_Object* window,
Evas_Object* wkView);
+
private:
WrtDB::AppType m_type;
};
diff --git a/src/view/webkit/view_logic_usermedia_support.cpp b/src/view/webkit/view_logic_usermedia_support.cpp
index 445f754..c55f23a 100644
--- a/src/view/webkit/view_logic_usermedia_support.cpp
+++ b/src/view/webkit/view_logic_usermedia_support.cpp
@@ -27,7 +27,6 @@
#include
namespace ViewModule {
-
namespace {
const char* const USERMEDIA_USE_ASK_BODY =
"This application wants to use your media";
@@ -92,7 +91,7 @@ void popupCallback(void* data, Evas_Object* obj, void* /*eventInfo*/)
} // namespace
void UsermediaSupport::usermediaPermissionRequest(Evas_Object* window,
- void* data)
+ void* data)
{
LogDebug("usermediaPermissionRequest called");
Assert(window);
diff --git a/src/view/webkit/view_logic_usermedia_support.h b/src/view/webkit/view_logic_usermedia_support.h
index 27f5e70..f6ab0e3 100644
--- a/src/view/webkit/view_logic_usermedia_support.h
+++ b/src/view/webkit/view_logic_usermedia_support.h
@@ -25,11 +25,9 @@
namespace ViewModule {
namespace UsermediaSupport {
-
void usermediaPermissionRequest(
- Evas_Object* window,
- void* data);
-
+ Evas_Object* window,
+ void* data);
} // namespace UsermediaSupport
} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_utils.cpp b/src/view/webkit/view_logic_utils.cpp
index 49dbb41..df08cde 100644
--- a/src/view/webkit/view_logic_utils.cpp
+++ b/src/view/webkit/view_logic_utils.cpp
@@ -23,7 +23,6 @@
namespace ViewModule {
namespace Utils {
-
DPL::OptionalString toString(WKStringRef str)
{
if (WKStringIsEmpty(str)) {
@@ -71,6 +70,5 @@ DPL::OptionalString toString(WKErrorRef err)
WKRelease(desc);
return str;
}
-
} // namespace Utils
} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_utils.h b/src/view/webkit/view_logic_utils.h
index 4908263..42be1ae 100644
--- a/src/view/webkit/view_logic_utils.h
+++ b/src/view/webkit/view_logic_utils.h
@@ -28,13 +28,11 @@
namespace ViewModule {
namespace Utils {
-
DPL::OptionalString toString(WKStringRef str);
DPL::OptionalString toString(WKURLRef url);
DPL::OptionalString toString(WKURLRequestRef req);
DPL::OptionalString toString(WKFrameRef req);
DPL::OptionalString toString(WKErrorRef err);
-
} // namespace Utils
} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_web_notification_support.cpp b/src/view/webkit/view_logic_web_notification_support.cpp
index 11c3924..e0f840c 100644
--- a/src/view/webkit/view_logic_web_notification_support.cpp
+++ b/src/view/webkit/view_logic_web_notification_support.cpp
@@ -40,17 +40,15 @@ const char* const WEB_NOTIFICATION_ASK_BODY_PREFIX = "Do you want to allow ";
const char* const WEB_NOTIFICATION_ASK_BODY_POSTFIX =
" to use web notificaion?";
const char* const WEB_NOTIFICATION_ASK_CHECK = "Don't ask again";
-
}
namespace ViewModule {
namespace WebNotification {
-
using namespace SecurityOriginDB;
using namespace ViewModule::SecurityOriginSupportUtil;
-class WebNotificationPermissionData
- : public ViewModule::SecurityOriginSupportUtil::PermissionData
+class WebNotificationPermissionData :
+ public ViewModule::SecurityOriginSupportUtil::PermissionData
{
public:
Ewk_Context* m_ewkContext;
@@ -60,13 +58,12 @@ class WebNotificationPermissionData
SecurityOriginDB::SecurityOriginData originData,
Ewk_Context* ewkContext,
void* data) :
- ViewModule::SecurityOriginSupportUtil::PermissionData(
- originDao,
- originData,
- data),
- m_ewkContext(ewkContext)
- {
- };
+ ViewModule::SecurityOriginSupportUtil::PermissionData(
+ originDao,
+ originData,
+ data),
+ m_ewkContext(ewkContext)
+ {}
};
bool notificationShow(WebNotificationDataPtr notiData);
@@ -88,8 +85,7 @@ WebNotificationData::WebNotificationData(WidgetModel* widgetModel,
}
WebNotificationData::~WebNotificationData()
-{
-}
+{}
void webNotificationPermissionRequest(
Evas_Object* window,
@@ -132,9 +128,9 @@ void webNotificationPermissionRequest(
// ask to user
WebNotificationPermissionData* permissionData =
new WebNotificationPermissionData(securityOriginDAO,
- securityOriginData,
- ewkContext,
- data);
+ securityOriginData,
+ ewkContext,
+ data);
// suspend notification
ewk_notification_permission_request_suspend(request);
@@ -160,7 +156,9 @@ bool notificationShow(WebNotificationDataPtr notiData)
Try {
// create notification
noti_h = notification_new(
- NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, notiData->m_id);
+ NOTIFICATION_TYPE_NOTI,
+ NOTIFICATION_GROUP_ID_NONE,
+ notiData->m_id);
if (!noti_h) {
LogError("Fail to notification_new");
return false;
@@ -168,22 +166,22 @@ bool notificationShow(WebNotificationDataPtr notiData)
// set notification title
error = notification_set_text(
- noti_h,
- NOTIFICATION_TEXT_TYPE_TITLE,
- notiData->m_title.c_str(),
- NULL,
- NOTIFICATION_VARIABLE_TYPE_NONE);
+ noti_h,
+ NOTIFICATION_TEXT_TYPE_TITLE,
+ notiData->m_title.c_str(),
+ NULL,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
if (error != NOTIFICATION_ERROR_NONE) {
ThrowMsg(Exception::NotificationShowError, "Fail to set title");
}
// set notification content
error = notification_set_text(
- noti_h,
- NOTIFICATION_TEXT_TYPE_CONTENT,
- notiData->m_body.c_str(),
- NULL,
- NOTIFICATION_VARIABLE_TYPE_NONE);
+ noti_h,
+ NOTIFICATION_TEXT_TYPE_CONTENT,
+ notiData->m_body.c_str(),
+ NULL,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
if (error != NOTIFICATION_ERROR_NONE) {
ThrowMsg(Exception::NotificationShowError,
"Fail to set content:" << error);
@@ -202,9 +200,9 @@ bool notificationShow(WebNotificationDataPtr notiData)
// In this case, set to default package image.
if (true == validIconURL) {
error = notification_set_image(
- noti_h,
- NOTIFICATION_IMAGE_TYPE_ICON,
- notiData->m_iconURL.c_str());
+ noti_h,
+ NOTIFICATION_IMAGE_TYPE_ICON,
+ notiData->m_iconURL.c_str());
if (error != NOTIFICATION_ERROR_NONE) {
ThrowMsg(Exception::NotificationShowError,
"Fail to free notification: " << error);
@@ -226,8 +224,8 @@ bool notificationShow(WebNotificationDataPtr notiData)
if (noti_h) {
error = notification_free(noti_h);
if (error != NOTIFICATION_ERROR_NONE) {
- ThrowMsg(Exception::NotificationShowError,
- "Fail to free notification: " << error);
+ ThrowMsg(Exception::NotificationShowError,
+ "Fail to free notification: " << error);
}
noti_h = NULL;
}
@@ -270,8 +268,8 @@ bool downloadImage(WebNotificationDataPtr notiData)
// download path is
// /opt/apps/tizen_id/data + '/' + filename
std::string downloadPath =
- DPL::ToUTF8String(
- notiData->m_widgetModel->PersistentStoragePath.Get()) + "/";
+ DPL::ToUTF8String(
+ notiData->m_widgetModel->PersistentStoragePath.Get()) + "/";
LogDebug("downloadPath " << downloadPath);
// Make valid filename
@@ -319,7 +317,7 @@ bool downloadImage(WebNotificationDataPtr notiData)
}
fclose(fp);
curl_easy_cleanup(curl);
- } Catch (DPL::Exception) {
+ } Catch(DPL::Exception) {
LogError(_rethrown_exception.GetMessage());
fclose(fp);
curl_easy_cleanup(curl);
@@ -373,11 +371,12 @@ void popupCallback(void* data, Evas_Object* obj, void* /*eventInfo*/)
Result result = getResult(obj);
if (result != RESULT_UNKNOWN) {
- permData->m_originDao->setSecurityOriginData(permData->m_originData, result);
+ permData->m_originDao->setSecurityOriginData(permData->m_originData,
+ result);
}
Eina_Bool ret =
(result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) ?
- EINA_TRUE : EINA_FALSE;
+ EINA_TRUE : EINA_FALSE;
ewk_notification_permission_request_response(permData->m_ewkContext,
request,
ret);
@@ -385,7 +384,5 @@ void popupCallback(void* data, Evas_Object* obj, void* /*eventInfo*/)
evas_object_hide(popup);
evas_object_del(popup);
}
-
-
} // namespace WebNotification
} //namespace ViewModule
diff --git a/src/view/webkit/view_logic_web_notification_support.h b/src/view/webkit/view_logic_web_notification_support.h
index 2d8fd58..de37cac 100644
--- a/src/view/webkit/view_logic_web_notification_support.h
+++ b/src/view/webkit/view_logic_web_notification_support.h
@@ -30,13 +30,13 @@
//Forward declarations
class WidgetModel;
namespace SecurityOriginDB {
- class SecurityOriginDAO;
+class SecurityOriginDAO;
}
namespace ViewModule {
namespace WebNotification {
-
-class WebNotificationData {
+class WebNotificationData
+{
public:
WebNotificationData(WidgetModel* widgetModel, uint64_t id);
virtual ~WebNotificationData();
@@ -51,7 +51,8 @@ class WebNotificationData {
typedef std::shared_ptr WebNotificationDataPtr;
-class Exception {
+class Exception
+{
public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, InitError)
@@ -65,7 +66,6 @@ void webNotificationPermissionRequest(
Ewk_Context* ewkContext,
void* data);
bool showWebNotification(WebNotificationDataPtr notiData);
-
} // namespace SecuritySupport
} // namespace WebNotification
diff --git a/src/view/webkit/view_logic_web_storage_support.cpp b/src/view/webkit/view_logic_web_storage_support.cpp
index f1bf7d2..4b899a7 100644
--- a/src/view/webkit/view_logic_web_storage_support.cpp
+++ b/src/view/webkit/view_logic_web_storage_support.cpp
@@ -31,7 +31,6 @@
#include
namespace ViewModule {
-
using namespace SecurityOriginDB;
using namespace ViewModule::SecurityOriginSupportUtil;
@@ -56,11 +55,12 @@ void askUserForWebStorageCreatePermission(
LogDebug("askUserForWebStorageCreatePermission called");
PermissionData* permData = static_cast(data);
Ewk_Context_Exceeded_Quota* exceededQuota =
- static_cast(permData->m_data);
+ static_cast(permData->m_data);
std::ostringstream size;
- size << ewk_context_web_database_exceeded_quota_expected_usage_get(exceededQuota) /
- (1024 * 1024);
+ size << ewk_context_web_database_exceeded_quota_expected_usage_get(
+ exceededQuota) /
+ (1024 * 1024);
std::string body =
WEB_STORAGE_CREATE_ASK_BODY_PREFIX +
@@ -90,20 +90,21 @@ void popupCallback(void* data, Evas_Object* obj, void* /*eventInfo*/)
Assert(data);
PermissionData* permData = static_cast(data);
Ewk_Context_Exceeded_Quota* exceededQuota =
- static_cast(permData->m_data);
+ static_cast(permData->m_data);
Evas_Object* popup = getPopup(obj);
Result result = getResult(obj);
if (result != RESULT_UNKNOWN) {
- permData->m_originDao->setSecurityOriginData(permData->m_originData, result);
+ permData->m_originDao->setSecurityOriginData(permData->m_originData,
+ result);
}
- if (result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) {
+ if (result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) {
ewk_context_web_database_exceeded_quota_new_quota_set(
exceededQuota,
ewk_context_web_database_exceeded_quota_expected_usage_get(
exceededQuota) +
- 10*(1024*1024)); //10MB
+ 10 * (1024 * 1024)); //10MB
}
delete permData;
@@ -139,10 +140,10 @@ void WebStorageSupport::webStorageCreatePermissionRequest(
if (RESULT_ALLOW_ONCE == result || RESULT_ALLOW_ALWAYS == result) {
LogDebug("allow");
ewk_context_web_database_exceeded_quota_new_quota_set(
- exceededQuota,
- ewk_context_web_database_exceeded_quota_expected_usage_get(
- exceededQuota) +
- 10*(1024*1024)); //10MB
+ exceededQuota,
+ ewk_context_web_database_exceeded_quota_expected_usage_get(
+ exceededQuota) +
+ 10 * (1024 * 1024)); //10MB
return;
} else if (RESULT_DENY_ONCE == result || RESULT_DENY_ALWAYS == result) {
LogDebug("deny");
diff --git a/src/view/webkit/view_logic_web_storage_support.h b/src/view/webkit/view_logic_web_storage_support.h
index 537489d..2d77433 100644
--- a/src/view/webkit/view_logic_web_storage_support.h
+++ b/src/view/webkit/view_logic_web_storage_support.h
@@ -25,17 +25,15 @@
#include
namespace SecurityOriginDB {
- class SecurityOriginDAO;
+class SecurityOriginDAO;
}
namespace ViewModule {
namespace WebStorageSupport {
-
void webStorageCreatePermissionRequest(
- Evas_Object* window,
- SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
- void* data);
-
+ Evas_Object* window,
+ SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
+ void* data);
} // namespace WebStorageSupport
} // namespace ViewModule
diff --git a/src/wrt-client/splash_screen_support.cpp b/src/wrt-client/splash_screen_support.cpp
index 3d11e47..6cdce5b 100644
--- a/src/wrt-client/splash_screen_support.cpp
+++ b/src/wrt-client/splash_screen_support.cpp
@@ -23,7 +23,6 @@
#include
#include
-
SplashScreenSupport::SplashScreenSupport(Evas_Object* parent)
{
LogDebug("enter");
@@ -41,7 +40,8 @@ SplashScreenSupport::~SplashScreenSupport()
LogDebug("enter");
}
-bool SplashScreenSupport::createSplashScreen(const DPL::OptionalString imagePath)
+bool SplashScreenSupport::createSplashScreen(
+ const DPL::OptionalString imagePath)
{
LogDebug("initializing splash screen");
diff --git a/src/wrt-client/splash_screen_support.h b/src/wrt-client/splash_screen_support.h
index 9a4d548..b32aa09 100644
--- a/src/wrt-client/splash_screen_support.h
+++ b/src/wrt-client/splash_screen_support.h
@@ -27,7 +27,6 @@
#include
#include
-
class SplashScreenSupport
{
public:
@@ -37,6 +36,7 @@ class SplashScreenSupport
bool createSplashScreen(const DPL::OptionalString imagePath);
void startSplashScreen();
void stopSplashScreen();
+
private:
void setSplashImagePath(const char * image_path);
diff --git a/src/wrt-client/window_data.cpp b/src/wrt-client/window_data.cpp
old mode 100755
new mode 100644
index d021321..9088532
--- a/src/wrt-client/window_data.cpp
+++ b/src/wrt-client/window_data.cpp
@@ -39,7 +39,6 @@ char const* const INDICATOR = "indicator";
char const* const NOINDICATOR = "noindicator";
char const* const INTERNAL_LAYOUT = "internal_layout";
char const* const FLOATBACKWARD_BUTTON_STYLE = "wrt/backward";
-
} // anonymous namespace
WindowData::WindowData(unsigned long pid, bool manualInit) :
@@ -48,8 +47,7 @@ WindowData::WindowData(unsigned long pid, bool manualInit) :
{
m_win = createWindow(pid);
- if (!manualInit)
- {
+ if (!manualInit) {
init();
}
}
@@ -89,7 +87,7 @@ void WindowData::unsetEvasObjectForLayout()
void WindowData::toggleIndicator(bool fullscreen)
{
- LogDebug("fullscreen=" << (fullscreen?"true":"false"));
+ LogDebug("fullscreen=" << (fullscreen ? "true" : "false"));
if (!fullscreen) {
elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_SHOW);
@@ -99,8 +97,8 @@ void WindowData::toggleIndicator(bool fullscreen)
}
void WindowData::setViewMode(
- bool fullscreen,
- bool backbutton)
+ bool fullscreen,
+ bool backbutton)
{
LogDebug("setViewMode");
LogDebug("fullscreen: " << fullscreen);
@@ -113,7 +111,6 @@ void WindowData::setViewMode(
if (backbutton) {
createFloatBackButton();
}
-
}
void WindowData::createFloatBackButton()
@@ -150,7 +147,7 @@ Evas_Object* WindowData::createConformant(Evas_Object* parent)
Evas_Object* conformant = elm_conformant_add(parent);
evas_object_size_hint_weight_set(
- conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(conformant, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_win_resize_object_add(parent, conformant);
return conformant;
@@ -165,15 +162,15 @@ Evas_Object* WindowData::createPlatformLayout(Evas_Object* parent)
ADD_PROFILING_POINT("elm_layout_theme_set", "stop");
evas_object_size_hint_align_set(platform_layout,
- EVAS_HINT_FILL,
- EVAS_HINT_FILL);
+ EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
evas_object_size_hint_weight_set(platform_layout,
- EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
elm_object_content_set(parent, platform_layout);
edje_object_signal_emit(
- elm_layout_edje_get(platform_layout), ELM_STATE_SHOW_CONTENT, ELM);
+ elm_layout_edje_get(platform_layout), ELM_STATE_SHOW_CONTENT, ELM);
return platform_layout;
}
@@ -183,11 +180,11 @@ Evas_Object* WindowData::createNavigationBar(Evas_Object* parent)
Evas_Object* navigation = elm_naviframe_add(parent);
evas_object_size_hint_align_set(navigation,
- EVAS_HINT_FILL,
- EVAS_HINT_FILL);
+ EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
evas_object_size_hint_weight_set(navigation,
- EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
elm_object_part_content_set(parent, ELM_SWALLOW_CONTENT, navigation);
//elm_object_content_set(parent, navigation);
return navigation;
@@ -199,23 +196,23 @@ Evas_Object* WindowData::createUserLayout(Evas_Object* parent)
Evas_Object* layout = elm_layout_add(parent);
elm_layout_file_set(layout, DAEMON_EDJ_PATH, "client");
evas_object_size_hint_weight_set(
- layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
ADD_PROFILING_POINT("elm_naviframe_item_push", "start");
Elm_Object_Item* naviIt = elm_naviframe_item_push(
- /* Evas_Object *obj */
- parent,
- /* const char *title_label */
- "",
- /* Evas_Object *prev_btn */
- NULL,
- /* Evas_Object *next_btn */
- NULL,
- /* Evas_Object *content */
- layout,
- /* const char *item_style */
- NULL);
+ /* Evas_Object *obj */
+ parent,
+ /* const char *title_label */
+ "",
+ /* Evas_Object *prev_btn */
+ NULL,
+ /* Evas_Object *next_btn */
+ NULL,
+ /* Evas_Object *content */
+ layout,
+ /* const char *item_style */
+ NULL);
elm_naviframe_item_title_visible_set(naviIt, EINA_FALSE);
@@ -223,58 +220,58 @@ Evas_Object* WindowData::createUserLayout(Evas_Object* parent)
}
void WindowData::addNaviBackButtonCallback(
- const char* event,
- CallbackType callback,
- const void* data)
+ const char* event,
+ CallbackType callback,
+ const void* data)
{
Assert(m_naviBackButton != NULL && "m_naviBackButton is null");
evas_object_smart_callback_add(m_naviBackButton, event, callback, data);
}
void* WindowData::delNaviBackButtonCallback(
- const char* event,
- CallbackType callBack)
+ const char* event,
+ CallbackType callBack)
{
Assert(m_naviBackButton != NULL && "m_naviBackButton is null");
return evas_object_smart_callback_del(m_naviBackButton, event, callBack);
}
void WindowData::addFloatBackButtonCallback(
- const char* event,
- CallbackType callback,
- const void* data)
+ const char* event,
+ CallbackType callback,
+ const void* data)
{
Assert(m_floatBackButton != NULL && "m_floatBackButton is null");
evas_object_smart_callback_add(m_floatBackButton, event, callback, data);
}
void* WindowData::delFloatBackButtonCallback(
- const char* event,
- CallbackType callBack)
+ const char* event,
+ CallbackType callBack)
{
Assert(m_floatBackButton != NULL && "m_floatBackButton is null");
return evas_object_smart_callback_del(m_floatBackButton, event, callBack);
}
void WindowData::userlayoutCallbackAdd(
- const Evas_Callback_Type event,
- EvasCallbackType callback,
- const void* data)
+ const Evas_Callback_Type event,
+ EvasCallbackType callback,
+ const void* data)
{
Assert(m_user_layout != NULL && "m_user_layout is null");
evas_object_event_callback_add(m_user_layout, event, callback, data);
}
void* WindowData::userlayoutCallbackDel(
- const Evas_Callback_Type event,
- EvasCallbackType callBack)
+ const Evas_Callback_Type event,
+ EvasCallbackType callBack)
{
Assert(m_user_layout != NULL && "m_user_layout is null");
return evas_object_event_callback_del(m_user_layout, event, callBack);
}
void WindowData::emitSignalForUserLayout(
- const char* emission, const char* source)
+ const char* emission, const char* source)
{
LogInfo("emitSignalForUserLayout called");
Assert(m_user_layout != NULL && "m_user_layout is null");
@@ -282,7 +279,7 @@ void WindowData::emitSignalForUserLayout(
Assert(source != NULL && "source is null");
edje_object_signal_emit(
- elm_layout_edje_get(m_user_layout), emission, source);
+ elm_layout_edje_get(m_user_layout), emission, source);
}
void WindowData::toggleFullscreen(bool fullscreen)
@@ -298,8 +295,9 @@ void WindowData::toggleFullscreen(bool fullscreen)
return;
}
- if (!m_fullscreen) //If ViewMode is not fullscreen, toggle indicator
+ if (!m_fullscreen) { //If ViewMode is not fullscreen, toggle indicator
toggleIndicator(fullscreen);
+ }
alreadyFullscreen = !alreadyFullscreen;
}
diff --git a/src/wrt-client/window_data.h b/src/wrt-client/window_data.h
old mode 100755
new mode 100644
index 64c827b..389ca7c
--- a/src/wrt-client/window_data.h
+++ b/src/wrt-client/window_data.h
@@ -44,9 +44,9 @@ class WindowData : private DPL::Noncopyable
{
private:
typedef void (*CallbackType)(
- void* data, Evas_Object* obj, void* event_info);
+ void* data, Evas_Object* obj, void* event_info);
typedef void (*EvasCallbackType)(
- void* data, Evas* evas, Evas_Object* obj, void* event_info);
+ void* data, Evas* evas, Evas_Object* obj, void* event_info);
struct EventWithFunction
{
@@ -56,8 +56,7 @@ class WindowData : private DPL::Noncopyable
const char * a_eventName) :
function(a_function),
eventName(a_eventName)
- {
- }
+ {}
};
typedef std::vector EventWithFunctionVector;
@@ -65,40 +64,40 @@ class WindowData : private DPL::Noncopyable
Evas_Object* m_win;
Evas_Object* m_user_layout;
- explicit WindowData(unsigned long pid, bool manualInit=false);
+ explicit WindowData(unsigned long pid, bool manualInit = false);
virtual ~WindowData();
void init();
void setEvasObjectForLayout(Evas_Object* evas_object);
void unsetEvasObjectForLayout();
void addNaviBackButtonCallback(
- const char* event,
- CallbackType callback,
- const void* data);
+ const char* event,
+ CallbackType callback,
+ const void* data);
void* delNaviBackButtonCallback(
- const char* event,
- CallbackType callBack);
+ const char* event,
+ CallbackType callBack);
void addFloatBackButtonCallback(
- const char* event,
- CallbackType callback,
- const void* data);
+ const char* event,
+ CallbackType callback,
+ const void* data);
void* delFloatBackButtonCallback(
- const char* event,
- CallbackType callBack);
+ const char* event,
+ CallbackType callBack);
void userlayoutCallbackAdd(
- const Evas_Callback_Type event,
- EvasCallbackType callback,
- const void* data);
+ const Evas_Callback_Type event,
+ EvasCallbackType callback,
+ const void* data);
void* userlayoutCallbackDel(
- const Evas_Callback_Type event,
- EvasCallbackType callback);
+ const Evas_Callback_Type event,
+ EvasCallbackType callback);
void emitSignalForUserLayout(
- const char* emission,
- const char* source);
+ const char* emission,
+ const char* source);
void setViewMode(
- bool fullscreen,
- bool backbutton);
+ bool fullscreen,
+ bool backbutton);
void toggleFullscreen(bool fullscreen);
diff --git a/src/wrt-client/wrt-client.cpp b/src/wrt-client/wrt-client.cpp
old mode 100755
new mode 100644
index 16d8fb9..7a17e38
--- a/src/wrt-client/wrt-client.cpp
+++ b/src/wrt-client/wrt-client.cpp
@@ -72,7 +72,6 @@ void WrtClient::OnStop()
LogInfo("Stopping Dummy Client");
}
-
void WrtClient::OnCreate()
{
LogInfo("On Create");
@@ -80,7 +79,6 @@ void WrtClient::OnCreate()
ewk_init();
}
-
void WrtClient::OnResume()
{
if (m_widgetState != WidgetState_Suspended) {
@@ -91,7 +89,6 @@ void WrtClient::OnResume()
m_widgetState = WidgetState_Running;
}
-
void WrtClient::OnPause()
{
LogDebug("On pause");
@@ -124,12 +121,9 @@ void WrtClient::OnReset(bundle *b)
m_windowData->emitSignalForUserLayout(EDJE_SHOW_BACKWARD_SIGNAL, "");
m_widgetState = WidgetState_Running;
} else {
- if (true == checkArgument())
- {
+ if (true == checkArgument()) {
setStep();
- }
- else
- {
+ } else {
showHelpAndQuit();
}
}
@@ -161,7 +155,7 @@ bool WrtClient::checkArgument()
{
std::string tizenId = getTizenIdFromArgument(m_argc, m_argv);
- if(tizenId.empty()){
+ if (tizenId.empty()) {
// Just show help
return false;
} else {
@@ -190,7 +184,8 @@ std::string WrtClient::getTizenIdFromArgument(int argc, char **argv)
if (arg == "-h" || arg == "--help") {
return "";
} else if (arg == "-l" || arg == "--launch" ||
- arg == "-t" || arg == "--tizen") {
+ arg == "-t" || arg == "--tizen")
+ {
if (argc != 3) {
return "";
}
@@ -261,9 +256,9 @@ bool WrtClient::checkDebugMode(SDKDebugData* debugData)
// In WAC widget, only test widgets can use web inspector.
// In TIZEN widget,
// every launched widgets as debug mode can use it.
- if (m_dao->getWidgetType().appType == WrtDB::APP_TYPE_WAC20)
- {
- bool developerMode = WRT::CoreModuleSingleton::Instance().developerMode();
+ if (m_dao->getWidgetType().appType == WrtDB::APP_TYPE_WAC20) {
+ bool developerMode =
+ WRT::CoreModuleSingleton::Instance().developerMode();
//This code will be activated
//after WAC test certificate is used by SDK
//bool isTestWidget = view->m_widgetModel->IsTestWidget.Get();
@@ -301,7 +296,7 @@ void WrtClient::initStep()
// other type events. To give a chance of execute to other events,
// ecore_timer_add was used.
DPL::Event::ControllerEventHandler::PostTimedEvent(
- NextStepEvent(),0.001);
+ NextStepEvent(), 0.001);
}
bool WrtClient::checkWACTestCertififedWidget()
@@ -325,12 +320,11 @@ bool WrtClient::checkWACTestCertififedWidget()
LogDebug("Is developer Mode: " << developerMode);
if (developerWidget) {
- if(!developerMode)
- {
+ if (!developerMode) {
LogError("WAC test certified developer widget is needed for " <<
- "developer mode");
+ "developer mode");
return false;
- }else{
+ } else {
//TODO: WR-4660 (show popup about developer widget
// during launch
LogInfo("POPUP: THIS IS TEST WIDGET!");
@@ -352,8 +346,7 @@ void WrtClient::loadFinishCallback(Evas_Object* webview)
// Start inspector server, if current mode is debugger mode.
// In the WK2 case, ewk_view_inspector_server_start should
// be called after WebProcess is created.
- if (checkDebugMode(debug))
- {
+ if (checkDebugMode(debug)) {
debug->portnum =
ewk_view_inspector_server_start(m_widget->GetCurrentWebview(), 0);
if (debug->portnum == 0) {
@@ -368,10 +361,9 @@ void WrtClient::loadFinishCallback(Evas_Object* webview)
//w3c packaging test debug (message on 4>)
const char * makeScreen = getenv(W3C_DEBUG_ENV_VARIABLE);
- if(makeScreen != NULL && strcmp(makeScreen, "1") == 0)
- {
+ if (makeScreen != NULL && strcmp(makeScreen, "1") == 0) {
FILE* doutput = fdopen(4, "w");
- fprintf(doutput,"didFinishLoadForFrameCallback: ready\n");
+ fprintf(doutput, "didFinishLoadForFrameCallback: ready\n");
fclose(doutput);
}
@@ -390,19 +382,18 @@ void WrtClient::loadFinishCallback(Evas_Object* webview)
m_returnStatus = ReturnStatus::Failed;
//shutdownStep
DPL::Event::ControllerEventHandler::
- PostEvent(NextStepEvent());
+ PostEvent(NextStepEvent());
}
- if(debug->debugMode)
- {
+ if (debug->debugMode) {
LogDebug("Send RT signal to wrt-launcher(pid: " << m_sdkLauncherPid);
union sigval sv;
/* send real time signal with result to wrt-launcher */
- if(webview) {
+ if (webview) {
LogDebug("userData->portnum : " << debug->portnum);
sv.sival_int = debug->portnum;
} else {
- sv.sival_int = -1;
+ sv.sival_int = -1;
}
sigqueue(m_sdkLauncherPid, SIGRTMIN, sv);
}
@@ -424,7 +415,7 @@ void WrtClient::webkitExitCallback()
LogDebug("window close called, terminating app");
SwitchToStep(&WrtClient::shutdownStep);
DPL::Event::ControllerEventHandler::PostEvent(
- NextStepEvent());
+ NextStepEvent());
}
void WrtClient::webCrashCallback()
@@ -432,10 +423,9 @@ void WrtClient::webCrashCallback()
LogError("webProcess crashed");
SwitchToStep(&WrtClient::shutdownStep);
DPL::Event::ControllerEventHandler::PostEvent(
- NextStepEvent());
+ NextStepEvent());
}
-
void WrtClient::launchStep()
{
ADD_PROFILING_POINT("launchStep", "start");
@@ -443,35 +433,35 @@ void WrtClient::launchStep()
ADD_PROFILING_POINT("getRunnableWidgetObject", "start");
m_widget = WRT::CoreModuleSingleton::Instance()
- .getRunnableWidgetObject(m_tizenId);
+ .getRunnableWidgetObject(m_tizenId);
ADD_PROFILING_POINT("getRunnableWidgetObject", "stop");
if (!m_widget) {
LogError("RunnableWidgetObject is NULL, stop launchStep");
DPL::Event::ControllerEventHandler::PostEvent(
- NextStepEvent());
+ NextStepEvent());
return;
}
if (m_widgetState == WidgetState_Running) {
LogWarning("Widget already running, stop launchStep");
DPL::Event::ControllerEventHandler::PostEvent(
- NextStepEvent());
+ NextStepEvent());
return;
}
if (m_widgetState == WidgetState_Authorizing) {
LogWarning("Widget already authorizing, stop launchStep");
DPL::Event::ControllerEventHandler