Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / android_webview / browser / aw_content_browser_client.cc
index b1edcfd..1ba73c7 100644 (file)
@@ -18,6 +18,7 @@
 #include "android_webview/common/url_constants.h"
 #include "base/base_paths_android.h"
 #include "base/path_service.h"
+#include "components/cdm/browser/cdm_message_filter_android.h"
 #include "content/public/browser/access_token_store.h"
 #include "content/public/browser/browser_message_filter.h"
 #include "content/public/browser/browser_thread.h"
@@ -207,6 +208,7 @@ void AwContentBrowserClient::RenderProcessWillLaunch(
       host->GetID(), content::kFileScheme);
 
   host->AddFilter(new AwContentsMessageFilter(host->GetID()));
+  host->AddFilter(new cdm::CdmMessageFilterAndroid());
 }
 
 net::URLRequestContextGetter* AwContentBrowserClient::CreateRequestContext(
@@ -359,10 +361,13 @@ void AwContentBrowserClient::SelectClientCertificate(
       const net::HttpNetworkSession* network_session,
       net::SSLCertRequestInfo* cert_request_info,
       const base::Callback<void(net::X509Certificate*)>& callback) {
-  LOG(WARNING) << "Client certificate request from "
-        << cert_request_info->host_and_port.ToString()
-        << " rejected. (Client certificates not supported in WebView)";
-  callback.Run(NULL);
+  AwContentsClientBridgeBase* client =
+      AwContentsClientBridgeBase::FromID(render_process_id, render_frame_id);
+  if (client) {
+    client->SelectClientCertificate(cert_request_info, callback);
+  } else {
+    callback.Run(NULL);
+  }
 }
 
 blink::WebNotificationPresenter::Permission
@@ -376,16 +381,9 @@ blink::WebNotificationPresenter::Permission
 
 void AwContentBrowserClient::ShowDesktopNotification(
     const content::ShowDesktopNotificationHostMsgParams& params,
-    int render_process_id,
-    int render_view_id,
-    bool worker) {
-  NOTREACHED() << "Android WebView does not support desktop notifications.";
-}
-
-void AwContentBrowserClient::CancelDesktopNotification(
-    int render_process_id,
-    int render_view_id,
-    int notification_id) {
+    content::RenderFrameHost* render_frame_host,
+    content::DesktopNotificationDelegate* delegate,
+    base::Closure* cancel_callback) {
   NOTREACHED() << "Android WebView does not support desktop notifications.";
 }
 
@@ -501,4 +499,12 @@ void AwContentBrowserClient::OverrideWebkitPrefs(content::RenderViewHost* rvh,
       content::WebContents::FromRenderViewHost(rvh), web_prefs);
 }
 
+#if defined(VIDEO_HOLE)
+content::ExternalVideoSurfaceContainer*
+AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer(
+    content::WebContents* web_contents) {
+  return native_factory_->CreateExternalVideoSurfaceContainer(web_contents);
+}
+#endif
+
 }  // namespace android_webview