Change allow_download in ResourceRequestInfoImpl to an enum

Motivation: Currently the |allow_download| flag in
|ResourceRequestInfoImpl| can be set to false in the circumstances of
Viewsource, Interstitial, etc. In all these cases, it's safe to
skip intercepting the resource before plugins handler is set up
(see MimeSniffingResourceHandler::MaybeStartInterception()). However,
this may not always be the case if we want to exploit this flag to
prevent download in other circumstances, e.g. in adframe. In this case,
bypassing the setup of plugin handler will also prevent a PDF to
display in adframe, although the restriction was to prevent just
download in adframe.

Therefore, I'm changing the boolean |allow_download| inside
|ResourceRequestInfoImpl| to 3 state enum, which allows us to differentiate
between a safe immediate prevention (Viewsource, Interstitial, etc.) that we
have always been doing, and a prevention that should happen only after the
plugin handler is checked and possibly set up (AdFrame).

The following CL gives an idea of how the new enum will be used:
https://chromium-review.googlesource.com/c/chromium/src/+/1367912

Bug: 929911
Change-Id: I3b0ea45071dd14267cd8afc217d6e0e98d2873dc
Reviewed-on: https://chromium-review.googlesource.com/c/1361325
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Jochen Eisinger <[email protected]>
Reviewed-by: David Trainor <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Cr-Commit-Position: refs/heads/master@{#631769}
diff --git a/chrome/browser/extensions/extension_protocols_unittest.cc b/chrome/browser/extensions/extension_protocols_unittest.cc
index 982221f..b860393 100644
--- a/chrome/browser/extensions/extension_protocols_unittest.cc
+++ b/chrome/browser/extensions/extension_protocols_unittest.cc
@@ -332,12 +332,12 @@
 
     content::ResourceRequestInfo::AllocateForTesting(
         request.get(), resource_type,
-        /* resource_context */nullptr,
+        /* resource_context */ nullptr,
         /*render_process_id=*/-1,
         /*render_view_id=*/-1,
         /*render_frame_id=*/-1,
         /*is_main_frame=*/resource_type == content::RESOURCE_TYPE_MAIN_FRAME,
-        /*allow_download=*/true,
+        content::ResourceInterceptPolicy::kAllowAll,
         /*is_async=*/false, content::PREVIEWS_OFF,
         /*navigation_ui_data*/ nullptr);
     request->Start();