set bg color to black for watchface app
authorCho Woong Suk <ws77.cho@samsung.com>
Tue, 12 Jul 2016 22:36:03 +0000 (07:36 +0900)
committerJongHeon Choi <j-h.choi@samsung.com>
Fri, 15 Jul 2016 05:22:59 +0000 (14:22 +0900)
Change-Id: Ie31b6e00638ed6390e50536e52399def4b550c93

runtime/browser/web_application.cc
runtime/browser/web_view.cc
runtime/browser/web_view.h
runtime/browser/web_view_impl.cc
runtime/browser/web_view_impl.h

index ef09759..b6f5bf1 100644 (file)
@@ -426,6 +426,15 @@ void WebApplication::Launch(std::unique_ptr<common::AppControl> appcontrol) {
   view->LoadUrl(res->uri(), res->mime());
   view_stack_.push_front(view);
 
+#ifdef PROFILE_WEARABLE
+  // ewk_view_bg_color_set is not working at webview initialization.
+  if (app_data_->app_type() == common::ApplicationData::WATCH) {
+    view->SetBGColor(0, 0, 0, 255);
+  } else {
+    view->SetBGColor(0, 0, 0, 0);
+  }
+#endif  // PROFILE_WEARABLE
+
   if (appcontrol->data(AUL_K_DEBUG) == "1") {
     debug_mode_ = true;
     LaunchInspector(appcontrol.get());
index fe33581..a8add92 100644 (file)
@@ -90,4 +90,10 @@ void WebView::SetDefaultEncoding(const std::string& encoding) {
   impl_->SetDefaultEncoding(encoding);
 }
 
+#ifdef PROFILE_WEARABLE
+void WebView::SetBGColor(int r, int g, int b, int a) {
+  impl_->SetBGColor(r, g, b, a);
+}
+#endif  // PROFILE_WEARABLE
+
 }  // namespace runtime
index 216dd5e..bb19e54 100644 (file)
@@ -128,6 +128,9 @@ class WebView {
   bool SetUserAgent(const std::string& user_agent);
   void SetCSPRule(const std::string& rule, bool report_only);
   void SetDefaultEncoding(const std::string& encoding);
+#ifdef PROFILE_WEARABLE
+  void SetBGColor(int r, int g, int b, int a);
+#endif
 
   void SetEventListener(EventListener* listener);
   Evas_Object* evas_object() const;
index d80525f..a7bf28a 100644 (file)
@@ -1002,4 +1002,10 @@ void WebViewImpl::SetDefaultEncoding(const std::string& encoding) {
   }
 }
 
+#ifdef PROFILE_WEARABLE
+void WebViewImpl::SetBGColor(int r, int g, int b, int a) {
+  ewk_view_bg_color_set(ewk_view_, r, g, b, a);
+}
+#endif
+
 }  // namespace runtime
index 9695e88..f5c5f6d 100644 (file)
@@ -48,6 +48,9 @@ class WebViewImpl {
   bool SetUserAgent(const std::string& user_agent);
   void SetCSPRule(const std::string& rule, bool report_only);
   void SetDefaultEncoding(const std::string& encoding);
+#ifdef PROFILE_WEARABLE
+  void SetBGColor(int r, int g, int b, int a);
+#endif
 
   void SetEventListener(WebView::EventListener* listener);
   Evas_Object* evas_object() const;