OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_PDF_BROWSER_PDF_WEB_CONTENTS_HELPER_H_ | 5 #ifndef COMPONENTS_PDF_BROWSER_PDF_WEB_CONTENTS_HELPER_H_ |
6 #define COMPONENTS_PDF_BROWSER_PDF_WEB_CONTENTS_HELPER_H_ | 6 #define COMPONENTS_PDF_BROWSER_PDF_WEB_CONTENTS_HELPER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 namespace pdf { | 22 namespace pdf { |
23 | 23 |
24 class PDFWebContentsHelperClient; | 24 class PDFWebContentsHelperClient; |
25 | 25 |
26 // Per-WebContents class to handle PDF messages. | 26 // Per-WebContents class to handle PDF messages. |
27 class PDFWebContentsHelper | 27 class PDFWebContentsHelper |
28 : public content::WebContentsObserver, | 28 : public content::WebContentsObserver, |
29 public content::WebContentsUserData<PDFWebContentsHelper>, | 29 public content::WebContentsUserData<PDFWebContentsHelper>, |
30 public mojom::PdfService { | 30 public mojom::PdfService { |
31 public: | 31 public: |
| 32 ~PDFWebContentsHelper() override; |
| 33 |
32 static void CreateForWebContentsWithClient( | 34 static void CreateForWebContentsWithClient( |
33 content::WebContents* contents, | 35 content::WebContents* contents, |
34 std::unique_ptr<PDFWebContentsHelperClient> client); | 36 std::unique_ptr<PDFWebContentsHelperClient> client); |
35 | 37 |
36 private: | 38 private: |
37 PDFWebContentsHelper(content::WebContents* web_contents, | 39 PDFWebContentsHelper(content::WebContents* web_contents, |
38 std::unique_ptr<PDFWebContentsHelperClient> client); | 40 std::unique_ptr<PDFWebContentsHelperClient> client); |
39 ~PDFWebContentsHelper() override; | |
40 | 41 |
41 // mojom::PdfService: | 42 // mojom::PdfService: |
42 void HasUnsupportedFeature() override; | 43 void HasUnsupportedFeature() override; |
43 void SaveUrlAs(const GURL& url, const content::Referrer& referrer) override; | 44 void SaveUrlAs(const GURL& url, const content::Referrer& referrer) override; |
44 void UpdateContentRestrictions(int32_t content_restrictions) override; | 45 void UpdateContentRestrictions(int32_t content_restrictions) override; |
45 | 46 |
46 content::WebContentsFrameBindingSet<mojom::PdfService> pdf_service_bindings_; | 47 content::WebContentsFrameBindingSet<mojom::PdfService> pdf_service_bindings_; |
47 std::unique_ptr<PDFWebContentsHelperClient> client_; | 48 std::unique_ptr<PDFWebContentsHelperClient> client_; |
48 | 49 |
49 DISALLOW_COPY_AND_ASSIGN(PDFWebContentsHelper); | 50 DISALLOW_COPY_AND_ASSIGN(PDFWebContentsHelper); |
50 }; | 51 }; |
51 | 52 |
52 } // namespace pdf | 53 } // namespace pdf |
53 | 54 |
54 #endif // COMPONENTS_PDF_BROWSER_PDF_WEB_CONTENTS_HELPER_H_ | 55 #endif // COMPONENTS_PDF_BROWSER_PDF_WEB_CONTENTS_HELPER_H_ |
OLD | NEW |