Component Updater should send X-GoogleUpdate-Interactivity header.

This header is sent only for update check requests. Therefore,there
is an optional type to indicate abstract out both the presence and
the value of the header.

Bug: 813193
Change-Id: I3de36b885cbea0ec7b56886ec7223ad486cfe2fb
Reviewed-on: https://chromium-review.googlesource.com/925453
Reviewed-by: Julian Pastarmov <[email protected]>
Reviewed-by: Joshua Pawlicki <[email protected]>
Commit-Queue: Sorin Jianu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#538140}
diff --git a/components/update_client/request_sender.h b/components/update_client/request_sender.h
index 75f1ef9..f833fe4 100644
--- a/components/update_client/request_sender.h
+++ b/components/update_client/request_sender.h
@@ -14,6 +14,7 @@
 #include "base/callback.h"
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
+#include "base/optional.h"
 #include "base/threading/thread_checker.h"
 #include "net/url_request/url_fetcher_delegate.h"
 #include "url/gurl.h"
@@ -55,9 +56,14 @@
   ~RequestSender() override;
 
   // |use_signing| enables CUP signing of protocol messages exchanged using
-  // this class.
+  // this class. |is_foreground| controls the presence and the value for the
+  // X-GoogleUpdate-Interactvity header serialized in the protocol request.
+  // If this optional parameter is set, the values of "fg" or "bg" are sent
+  // for true or false values of this parameter. Otherwise the header is not
+  // sent at all.
   void Send(bool use_signing,
             const std::string& request_body,
+            base::Optional<bool> is_foreground,
             const std::vector<GURL>& urls,
             RequestSenderCallback request_sender_callback);
 
@@ -100,6 +106,7 @@
   bool use_signing_;  // True if CUP signing is used.
   std::vector<GURL> urls_;
   std::string request_body_;
+  base::Optional<bool> is_foreground_;
   RequestSenderCallback request_sender_callback_;
 
   std::string public_key_;