Also use DevicePolicy::GetAuP2PEnabled() to determine if p2p is enabled

With this change update_engine will use p2p either if the user has
manually enabled it (through the crosh flag) OR if the enterprise has
enabled it in Enterprise Policy.

BUG=chromium:260442
TEST=New unit tests + unit tests pass.

Change-Id: I54cd92c481bd2fd7c90232d7137ce2b37fa2ce61
Reviewed-on: https://chromium-review.googlesource.com/168950
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
diff --git a/p2p_manager.h b/p2p_manager.h
index a38f648..e525746 100644
--- a/p2p_manager.h
+++ b/p2p_manager.h
@@ -12,6 +12,8 @@
 #include <base/file_path.h>
 #include <base/memory/ref_counted.h>
 #include <base/time.h>
+#include <policy/device_policy.h>
+#include <policy/libpolicy.h>
 
 #include "update_engine/prefs_interface.h"
 
@@ -46,6 +48,10 @@
   // If the lookup failed, |url| is empty.
   typedef base::Callback<void(const std::string& url)> LookupCallback;
 
+  // Use the device policy specified by |device_policy|. If this is
+  // NULL, then no device policy is used.
+  virtual void SetDevicePolicy(const policy::DevicePolicy* device_policy) = 0;
+
   // Returns true if - and only if - P2P should be used on this
   // device. This value is derived from a variety of sources including
   // enterprise policy.