[M120 Migration][hbbtv] Audio tracks count notification
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / web_contents_delegate_efl.cc
index 83ecaec..01f2d66 100644 (file)
@@ -419,21 +419,22 @@ void WebContentsDelegateEfl::RequestCertificateConfirm(
     bool /*strict_enforcement*/,
     base::OnceCallback<void(CertificateRequestResultType)> callback) {
   std::string pem_certificate;
+  const GURL request_url(url);
   if (!net::X509Certificate::GetPEMEncoded(ssl_info.cert->cert_buffer(),
                                            &pem_certificate)) {
-    LOG(INFO) << "Certificate for URL: " << url.spec()
+    LOG(INFO) << "Certificate for URL: " << request_url.spec()
               << " could not be opened";
     std::move(callback).Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL);
     return;
   }
   certificate_policy_decision_.reset(new _Ewk_Certificate_Policy_Decision(
-      url, pem_certificate, is_main_frame_request, cert_error,
+      request_url, pem_certificate, is_main_frame_request, cert_error,
       std::move(callback)));
 
   web_view_->SmartCallback<EWebViewCallbacks::RequestCertificateConfirm>().call(
       certificate_policy_decision_.get());
-  LOG(INFO) << "Certificate policy decision called for URL: " << url.spec()
-            << " with cert_error: " << cert_error;
+  LOG(INFO) << "Certificate policy decision called for URL: "
+            << request_url.spec() << " with cert_error: " << cert_error;
 
   // if policy is suspended, the API takes over the policy object lifetime
   // and policy will be deleted after decision is made
@@ -454,7 +455,8 @@ void WebContentsDelegateEfl::RequestCertificateConfirm(
       // By default chromium-efl allows page to be opened with certificate
       // compromise.
       certificate_policy_decision_->SetDecision(true);
-      LOG(WARNING) << "Certificate for " << url.spec() << " was compromised";
+      LOG(WARNING) << "Certificate for " << request_url.spec()
+                   << " was compromised";
     }
   }
 }
@@ -821,6 +823,26 @@ void WebContentsDelegateEfl::DidEdgeScrollBy(const gfx::Point& offset,
     web_view_->InvokeEdgeScrollByCallback(offset, handled);
 }
 
+void WebContentsDelegateEfl::MoveFocusToBrowser(int direction) {
+  if (web_view_) {
+    web_view_->SmartCallback<EWebViewCallbacks::AtkKeyEventNotHandled>().call(
+        &direction);
+  }
+}
+
+void WebContentsDelegateEfl::WillDraw(int new_rotation,
+                                      gfx::Size frame_data_output_size) {
+  if (web_view_) {
+    if (web_view_->GetRotationChanged()) {
+      web_view_->SetRotationChanged(false);
+      LOG(ERROR) << __func__ << " frame_data_output_size "
+                 << frame_data_output_size.ToString() << " new rotation "
+                 << new_rotation;
+      web_view_->SmartCallback<EWebViewCallbacks::RotatePrepared>().call(0);
+    }
+  }
+}
+
 bool WebContentsDelegateEfl::IsHighBitRate() const {
   return web_view_ ? web_view_->IsHighBitRate() : false;
 }
@@ -866,6 +888,15 @@ void WebContentsDelegateEfl::NotifyPlaybackState(int state,
   }
 }
 
+void WebContentsDelegateEfl::NotifyAudioTracksCount(
+    int player_id,
+    unsigned audio_tracks_count) {
+  if (web_view_)
+    web_view_->NotifyAudioTracksCount(player_id, audio_tracks_count);
+  else
+    LOG(INFO) << "web_view_ is null";
+}
+
 void WebContentsDelegateEfl::OnIsVideoPlayingGet(bool is_playing,
                                                  int callback_id) {
   if (web_view_)
@@ -882,4 +913,16 @@ void WebContentsDelegateEfl::VideoPlayingStatusReceived(bool is_playing,
     LOG(INFO) << "web_view_ is null";
 }
 #endif
+
+void WebContentsDelegateEfl::UpdateTooltipUnderCursor(
+    const std::u16string& text) {
+  std::string tooltip = base::UTF16ToUTF8(text);
+  LOG(INFO) << __func__ << " " << tooltip.c_str();
+  if (tooltip.empty()) {
+    web_view_->SmartCallback<EWebViewCallbacks::TooltipTextUnset>().call();
+  } else {
+    web_view_->SmartCallback<EWebViewCallbacks::TooltipTextSet>().call(
+        tooltip.c_str());
+  }
+}
 }  // namespace content