arc: Receive NativeBridge metric from container

We will record it for UMA as the next step.

BUG=b:63134383
TEST=Debug print and check the received value.

Change-Id: If7590ceacfed4328ccead78922d44976ac29d9ff
Reviewed-on: https://chromium-review.googlesource.com/802998
Commit-Queue: Lev Rumyantsev <[email protected]>
Reviewed-by: Jorge Lucangeli Obes <[email protected]>
Reviewed-by: Yusuke Sato <[email protected]>
Cr-Commit-Position: refs/heads/master@{#522007}
diff --git a/components/arc/metrics/arc_metrics_service.h b/components/arc/metrics/arc_metrics_service.h
index 76ea2e8..05405c2 100644
--- a/components/arc/metrics/arc_metrics_service.h
+++ b/components/arc/metrics/arc_metrics_service.h
@@ -31,6 +31,19 @@
 class ArcMetricsService : public KeyedService,
                           public mojom::MetricsHost {
  public:
+  // This is public for testing only.
+  enum class NativeBridgeType {
+    // Native bridge value has not been received from the container yet.
+    UNKNOWN = 0,
+    // Native bridge is not used.
+    NONE = 1,
+    // Using houdini translator.
+    HOUDINI = 2,
+    // Using ndk-translation translator.
+    NDK_TRANSLATION = 3,
+    COUNT
+  };
+
   // Returns the factory instance for this class.
   static BrowserContextKeyedServiceFactory* GetFactory();
 
@@ -50,6 +63,11 @@
   // MetricsHost overrides.
   void ReportBootProgress(std::vector<mojom::BootProgressEventPtr> events,
                           mojom::BootType boot_type) override;
+  void ReportNativeBridge(mojom::NativeBridgeType native_bridge_type) override;
+
+  NativeBridgeType native_bridge_type_for_testing() const {
+    return native_bridge_type_;
+  }
 
  private:
   // Adapter to be able to also observe ProcessInstance events.
@@ -83,6 +101,8 @@
   ProcessObserver process_observer_;
   base::RepeatingTimer timer_;
 
+  NativeBridgeType native_bridge_type_;
+
   // Always keep this the last member of this class to make sure it's the
   // first thing to be destructed.
   base::WeakPtrFactory<ArcMetricsService> weak_ptr_factory_;