1 // Copyright 2017 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_COMMON_PDF_UTIL_H_ 6 #define CHROME_COMMON_PDF_UTIL_H_ 7 8 #include <string> 9 10 class GURL; 11 12 // Must be kept in sync with PDFLoadStatus enum in histograms.xml. 13 // This enum should be treated as append-only. 14 enum class PDFLoadStatus { 15 kLoadedFullPagePdfWithPdfium = 0, 16 kLoadedEmbeddedPdfWithPdfium = 1, 17 kShowedDisabledPluginPlaceholderForEmbeddedPdf = 2, 18 kTriggeredNoGestureDriveByDownload = 3, 19 kLoadedIframePdfWithNoPdfViewer = 4, 20 kViewPdfClickedInPdfPluginPlaceholder = 5, 21 kPdfLoadStatusCount 22 }; 23 24 void ReportPDFLoadStatus(PDFLoadStatus status); 25 26 // Returns the HTML contents of the placeholder. 27 std::string GetPDFPlaceholderHTML(const GURL& pdf_url); 28 29 constexpr char kPDFMimeType[] = "application/pdf"; 30 31 #endif // CHROME_COMMON_PDF_UTIL_H_ 32