AU: add an interactive flag to Omaha requests

Such a flag can be used to distinguish between user-initiated
(interactive) checks and those that are due to background scheduling. In
the former case, we may want to suppress the probabilistic throttling
that's commonly used with latest releases. This CL piggybacks the new
functionality on top of an existing dataflow used for distinguishing
between interactive / scheduled checks, only it pushes it further so it
is evident in the Omaha request as well.

Comes with a unit test for ensuring that the Omaha flag is set as
expected.

BUG=chromium-os:26594
TEST=Dbus initiated checks correctly tainted

Change-Id: Ia2b3ff5ce3a866c64e453557028b8cbd92c1a258
Reviewed-on: https://gerrit.chromium.org/gerrit/41081
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/omaha_request_params.cc b/omaha_request_params.cc
index d857297..46cd5aa 100644
--- a/omaha_request_params.cc
+++ b/omaha_request_params.cc
@@ -41,7 +41,8 @@
 
 bool OmahaRequestDeviceParams::Init(const std::string& in_app_version,
                                     const std::string& in_update_url,
-                                    const std::string& in_release_track) {
+                                    const std::string& in_release_track,
+                                    bool in_interactive) {
   bool stateful_override = !ShouldLockDown();
   os_platform = OmahaRequestParams::kOsPlatform;
   os_version = OmahaRequestParams::kOsVersion;
@@ -99,6 +100,10 @@
                   NULL,
                   stateful_override) :
       in_update_url;
+
+  // Set the interactive flag accordingly.
+  interactive = in_interactive;
+
   return true;
 }
 
@@ -122,7 +127,7 @@
 
 bool OmahaRequestDeviceParams::SetDeviceTrack(const std::string& track) {
   OmahaRequestDeviceParams params;
-  TEST_AND_RETURN_FALSE(params.Init("", "", ""));
+  TEST_AND_RETURN_FALSE(params.Init("", "", "", false));
   return params.SetTrack(track);
 }
 
@@ -130,7 +135,7 @@
   OmahaRequestDeviceParams params;
   // Note that params.app_track is an empty string if the value in
   // lsb-release file is invalid. See Init() for details.
-  return params.Init("", "", "") ? params.app_track : "";
+  return params.Init("", "", "", false) ? params.app_track : "";
 }
 
 string OmahaRequestDeviceParams::GetLsbValue(const string& key,