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 ef097590d93bce6f3f09fd6a672af6331e6a66c1..b6f5bf16bb80eb8033735dfbca4d4593ca4ea200 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 fe3358185b8f12154be62a4ccae3d06928bffd41..a8add92445ac5277984d6e239089517bb50043ad 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 216dd5ec2f5aae8ca73b52d70de043e2daa68962..bb19e5449f4eb51b7f828cc68cf4a55e8c368641 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 d80525fd26ca20102a13bdf6f63f450ed53afbae..a7bf28a32a642dd302f5407057ab4669765520ac 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 9695e8897968ebc45ace531851a785a3ac513c19..f5c5f6dad04afa30dfa830a58a28e13d75c4551c 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;