ActivateContents(source);
EWebView* wv =
- WebViewDelegateEwk::GetInstance().GetWebViewFromEvasObject(new_object);
+ WebViewDelegateEwk::GetInstance().GetEWebViewFromEwkView(new_object);
DCHECK(wv);
wv->SetURL(url);
return NULL;
return source;
}
+#if BUILDFLAG(IS_TIZEN_TV)
+void WebContentsDelegateEfl::NotifyMediaStateChanged(uint32_t type,
+ uint32_t previous,
+ uint32_t current) {
+ if (!web_view_) {
+ LOG(ERROR) << "web_view_ is null";
+ return;
+ }
+
+ web_view_->NotifyMediaStateChanged(type, previous, current);
+}
+
+void WebContentsDelegateEfl::GetMediaDeviceList(EnumerationCallback cb) {
+ MediaCaptureDevices::GetInstance()->GetMediaDeviceList(std::move(cb));
+}
+#endif
+
void WebContentsDelegateEfl::NavigationStateChanged(
WebContents* source, InvalidateTypes changed_flags) {
// We always notfiy clients about title invalidation, even if its text
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
// 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";
}
}
}
RenderFrameHost* render_frame_host,
scoped_refptr<FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) {
- web_view_->ShowFileChooser(render_frame_host, params);
+ web_view_->ShowFileChooser(std::move(listener), params);
}
std::unique_ptr<ColorChooser> WebContentsDelegateEfl::OpenColorChooser(
// Update latest hovered url.
last_hovered_url_ = absolute_link_url;
}
+
+void WebContentsDelegateEfl::UpdateCurrentTime(double current_time) {
+ web_view_->UpdateCurrentTime(current_time);
+}
+
+void WebContentsDelegateEfl::UpdateEventData(void* data) {
+ web_view_->UpdateEventData(data);
+}
+
+void WebContentsDelegateEfl::NotifySubtitleState(int state, double time_stamp) {
+ web_view_->NotifySubtitleState(state, time_stamp);
+}
+
+void WebContentsDelegateEfl::NotifySubtitlePlay(int active_track_id,
+ const std::string& url,
+ const std::string& lang) {
+ web_view_->NotifySubtitlePlay(active_track_id, url.c_str(), lang.c_str());
+}
+
+void WebContentsDelegateEfl::NotifySubtitleData(int track_id,
+ double time_stamp,
+ const std::string& data,
+ unsigned int size) {
+ web_view_->NotifySubtitleData(track_id, time_stamp, data, size);
+}
+
+void WebContentsDelegateEfl::NotifyFirstTimeStamp(unsigned long long timestamp,
+ int time_base_num,
+ int time_base_den) {
+ return web_view_->NotifyFirstTimeStamp(timestamp, time_base_num,
+ time_base_den);
+}
+
+void WebContentsDelegateEfl::NotifyPESData(const std::string& buf,
+ unsigned int len,
+ int media_position) {
+ return web_view_->NotifyPESData(buf, len, media_position);
+}
#endif
void WebContentsDelegateEfl::OnGetMainFrameScrollbarVisible(int callback_id,
if (web_view_)
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;
+}
+
+void WebContentsDelegateEfl::NotifyParentalRatingInfo(const std::string& info,
+ const std::string& url) {
+ if (web_view_)
+ web_view_->NotifyParentalRatingInfo(info.c_str(), url.c_str());
+ else
+ LOG(ERROR) << "web_view_ is null";
+}
+
+void WebContentsDelegateEfl::NotifyDownloadableFontInfo(
+ const std::string& scheme_id_uri,
+ const std::string& value,
+ const std::string& data,
+ int type) {
+ if (!web_view_)
+ return;
+ web_view_->NotifyDownloadableFontInfo(scheme_id_uri.c_str(), value.c_str(),
+ data.c_str(), type);
+}
+
+void WebContentsDelegateEfl::NotifyPlaybackState(int state,
+ int player_id,
+ const std::string& url,
+ const std::string& mime_type,
+ bool* media_resource_acquired,
+ std::string* translated_url,
+ std::string* drm_info) {
+ if (!web_view_)
+ return;
+ std::vector<std::string> data = web_view_->NotifyPlaybackState(
+ state, player_id, url.empty() ? "" : url.c_str(),
+ mime_type.empty() ? "" : mime_type.c_str());
+ if (data.size()) {
+ if (media_resource_acquired)
+ *media_resource_acquired = !data.at(0).empty() ? true : false;
+ if (translated_url)
+ *translated_url = data.at(1);
+ if (drm_info)
+ *drm_info = data.at(2);
+ }
+}
+
+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_)
+ web_view_->InvokeIsVideoPlayingCallback(is_playing, callback_id);
+ else
+ LOG(INFO) << "web_view_ is null";
+}
+
+void WebContentsDelegateEfl::VideoPlayingStatusReceived(bool is_playing,
+ int callback_id) {
+ if (web_view_)
+ web_view_->InvokeIsVideoPlayingCallback(is_playing, callback_id);
+ else
+ 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