Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4219)

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2512123002: Shape Detection: QR detection in Chrome Android using Play Services (Closed)
Patch Set: dcheng@ request to check for |numPixels| overflow Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 1c7ce3b7eb720ea5a87af2bd1158e39a2da07c23..2cab771dcbe9857263ba97ea71a87b5e9eea2297 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -193,6 +193,7 @@
#include "services/service_manager/public/cpp/interface_registry.h"
#include "services/service_manager/public/cpp/service.h"
#include "storage/browser/fileapi/external_mount_points.h"
+#include "third_party/WebKit/public/platform/modules/shapedetection/barcodedetection.mojom.h"
#include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -1440,7 +1441,8 @@ bool IsAutoReloadVisibleOnlyEnabled() {
return true;
}
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) || \
+ defined(OS_ANDROID)
bool AreExperimentalWebPlatformFeaturesEnabled() {
const base::CommandLine& browser_command_line =
*base::CommandLine::ForCurrentProcess();
@@ -3027,6 +3029,19 @@ void ChromeContentBrowserClient::RegisterRenderFrameMojoInterfaces(
}
}
#endif
+
+#if defined(OS_ANDROID)
+ if (AreExperimentalWebPlatformFeaturesEnabled()) {
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderFrameHost(render_frame_host);
+ if (web_contents) {
+ registry->AddInterface(
+ web_contents->GetJavaInterfaces()
+ ->CreateInterfaceFactory<blink::mojom::BarcodeDetection>());
+ }
+ }
+#endif
+
}
void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess(

Powered by Google App Engine
This is Rietveld 408576698