[Offline pages]: Add ability to attribute download button clicks to apps

Bug: 734753
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ia3cf2158295dc7243d4659938673a25ce44594d3
Reviewed-on: https://chromium-review.googlesource.com/560799
Commit-Queue: Cathy Li <[email protected]>
Reviewed-by: Demetrios Papadopoulos <[email protected]>
Reviewed-by: Min Qin <[email protected]>
Reviewed-by: Ted Choc <[email protected]>
Reviewed-by: Justin DeWitt <[email protected]>
Cr-Commit-Position: refs/heads/master@{#492994}
diff --git a/chrome/browser/offline_pages/offline_page_utils.cc b/chrome/browser/offline_pages/offline_page_utils.cc
index b847891d..c86158d 100644
--- a/chrome/browser/offline_pages/offline_page_utils.cc
+++ b/chrome/browser/offline_pages/offline_page_utils.cc
@@ -283,14 +283,24 @@
 void OfflinePageUtils::ScheduleDownload(content::WebContents* web_contents,
                                         const std::string& name_space,
                                         const GURL& url,
-                                        DownloadUIActionFlags ui_action) {
+                                        DownloadUIActionFlags ui_action,
+                                        const std::string& request_origin) {
   DCHECK(web_contents);
 
   OfflinePageTabHelper* tab_helper =
       OfflinePageTabHelper::FromWebContents(web_contents);
   if (!tab_helper)
     return;
-  tab_helper->ScheduleDownloadHelper(web_contents, name_space, url, ui_action);
+  tab_helper->ScheduleDownloadHelper(web_contents, name_space, url, ui_action,
+                                     request_origin);
+}
+
+// static
+void OfflinePageUtils::ScheduleDownload(content::WebContents* web_contents,
+                                        const std::string& name_space,
+                                        const GURL& url,
+                                        DownloadUIActionFlags ui_action) {
+  ScheduleDownload(web_contents, name_space, url, ui_action, "");
 }
 
 // static