#define SESSION_COUNTER_INTERVAL 0.1
#define MAIN_LOOP_INTERVAL 1
+static const float FirstFrameDelayWaitTime = 2.0f;
using namespace extensions;
namespace runtime {
const char* kRecordPrivilege = "http://tizen.org/privilege/recorder";
const char* kStoragePrivilege = "http://tizen.org/privilege/unlimitedstorage";
const char* kUsermediaPrivilege = "http://tizen.org/privilege/mediacapture";
-const char* kNotiIconFile = "noti_icon.png";
+//const char* kNotiIconFile = "noti_icon.png";
const char* kFileScheme = "file://";
const char* kVisibilitySuspendFeature = "visibility,suspend";
lang_changed_mode_(false),
is_terminate_called_(false),
is_close_page_called_(false),
+ is_window_inactive_(false),
ewk_context_(
ewk_context_new_with_injected_bundle_path(INJECTED_BUNDLE_PATH)),
has_ownership_of_ewk_context_(true),
window_(window),
appid_(app_data->app_id()),
app_data_(app_data),
- locale_manager_(new common::LocaleManager()) {
+ locale_manager_(new common::LocaleManager()),
+ firstframe_delay_timer_(NULL) {
Initialize();
}
lang_changed_mode_(false),
is_terminate_called_(false),
is_close_page_called_(false),
+ is_window_inactive_(false),
ewk_context_(context),
has_ownership_of_ewk_context_(false),
window_(window),
appid_(app_data->app_id()),
app_data_(app_data),
- locale_manager_(new common::LocaleManager()) {
+ locale_manager_(new common::LocaleManager()),
+ firstframe_delay_timer_(NULL) {
Initialize();
}
if (view_stack_.size() > 0 && view_stack_.front() != NULL)
view_stack_.front()->SetVisibility(true);
+ is_window_inactive_ = false;
if (app_data_->setting_info() != NULL &&
app_data_->setting_info()->background_support_enabled()) {
return;
if (view_stack_.size() > 0 && view_stack_.front() != NULL)
view_stack_.front()->SetVisibility(false);
+ is_window_inactive_ = true;
if (app_data_->setting_info() != NULL &&
app_data_->setting_info()->background_support_enabled()) {
LOGGER(DEBUG) << "gone background (backgroud support enabed)";
}
void WebApplication::Terminate() {
+ is_window_inactive_ = false;
// Just process closing page once.
if (is_terminate_called_ || is_close_page_called_)
return;
ecore_main_loop_begin();
ecore_timer_del(main_loop.timer);
ecore_timer_del(session_counter.timer);
+ UnsetTimeout();
}
void WebApplication::ClosePage() {
LOGGER(DEBUG) << "Rendered";
splash_screen_->HideSplashScreen(SplashScreen::HideReason::RENDERED);
+ if (firstframe_delay_timer_) {
+ UnsetTimeout();
+ }
+
// Do not show(), active() for language change
- if(lang_changed_mode_ == false){
+ if(lang_changed_mode_ == false && is_window_inactive_ == false) {
// Show window after frame rendered.
if (common::getProfile() == common::kPROFILE_MOBILE) {
if (common::utils::StartsWith(view->GetUrl(), kFileScheme)) {
popup->Show();
}
+void WebApplication::SetTimeoutFirstFrameDelay() {
+ LOGGER(DEBUG);
+ firstframe_delay_timer_ = ecore_timer_add(
+ FirstFrameDelayWaitTime,
+ FirstFrameDelayTimerCallback, this);
+}
+
+Eina_Bool WebApplication::FirstFrameDelayTimerCallback(void* data) {
+ LOGGER(DEBUG) << "FrameRendered not obtained from engine. Show window";
+ WebApplication* This = static_cast<WebApplication*>(data);
+ /* Do not show(), active() when window is already in background */
+ if(This->is_window_inactive_ == false) {
+ This->window_->Show();
+ This->window_->Active();
+ }
+ This->firstframe_delay_timer_ = NULL;
+ return ECORE_CALLBACK_CANCEL;
+}
+
+void WebApplication::UnsetTimeout() {
+ LOGGER(DEBUG);
+ if (firstframe_delay_timer_) {
+ ecore_timer_del(firstframe_delay_timer_);
+ firstframe_delay_timer_ = NULL;
+ }
+}
+
} // namespace runtime
std::string data_path() const { return app_data_path_; }
bool launched() const { return launched_; }
std::list<WebView*> view_stack() const { return view_stack_; }
+ /*
+ * @function SetTimeoutFirstFrameDelay
+ * @desc Sets a fixed timer of 2 sec from the app create time
+ */
+ void SetTimeoutFirstFrameDelay();
virtual void OnCreatedNewWebView(WebView* view, WebView* new_view);
virtual void OnClosedWebView(WebView* view);
bool tizenWebKitCompatibilityEnabled() const { return (m_major && m_major < 3); }
} m_tizenCompatibilitySettings;
+ static Eina_Bool FirstFrameDelayTimerCallback(void* data);
+ void UnsetTimeout();
+
bool launched_;
bool debug_mode_;
bool verbose_mode_;
bool lang_changed_mode_;
bool is_terminate_called_;
bool is_close_page_called_;
+ bool is_window_inactive_;
Ewk_Context* ewk_context_;
bool has_ownership_of_ewk_context_;
NativeWindow* window_;
std::string csp_rule_;
std::string csp_report_rule_;
VCWebView* vc_webview_;
+ Ecore_Timer* firstframe_delay_timer_;
};
} // namespace runtime