| 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 21 matching lines...) Expand all Loading... |
| 32 content::WebContents* contents, | 32 content::WebContents* contents, |
| 33 std::unique_ptr<PDFWebContentsHelperClient> client); | 33 std::unique_ptr<PDFWebContentsHelperClient> client); |
| 34 | 34 |
| 35 OpenPDFInReaderPromptClient* open_in_reader_prompt() const { | 35 OpenPDFInReaderPromptClient* open_in_reader_prompt() const { |
| 36 return open_in_reader_prompt_.get(); | 36 return open_in_reader_prompt_.get(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void ShowOpenInReaderPrompt( | 39 void ShowOpenInReaderPrompt( |
| 40 std::unique_ptr<OpenPDFInReaderPromptClient> prompt); | 40 std::unique_ptr<OpenPDFInReaderPromptClient> prompt); |
| 41 | 41 |
| 42 void SetClientForTest(std::unique_ptr<PDFWebContentsHelperClient> client); |
| 43 |
| 42 private: | 44 private: |
| 43 PDFWebContentsHelper(content::WebContents* web_contents, | 45 PDFWebContentsHelper(content::WebContents* web_contents, |
| 44 std::unique_ptr<PDFWebContentsHelperClient> client); | 46 std::unique_ptr<PDFWebContentsHelperClient> client); |
| 45 ~PDFWebContentsHelper() override; | 47 ~PDFWebContentsHelper() override; |
| 46 | 48 |
| 47 // content::WebContentsObserver overrides: | 49 // content::WebContentsObserver overrides: |
| 48 bool OnMessageReceived(const IPC::Message& message, | 50 bool OnMessageReceived(const IPC::Message& message, |
| 49 content::RenderFrameHost* render_frame_host) override; | 51 content::RenderFrameHost* render_frame_host) override; |
| 50 void DidNavigateMainFrame( | 52 void DidNavigateMainFrame( |
| 51 const content::LoadCommittedDetails& details, | 53 const content::LoadCommittedDetails& details, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 63 // The model for the confirmation prompt to open a PDF in Adobe Reader. | 65 // The model for the confirmation prompt to open a PDF in Adobe Reader. |
| 64 std::unique_ptr<OpenPDFInReaderPromptClient> open_in_reader_prompt_; | 66 std::unique_ptr<OpenPDFInReaderPromptClient> open_in_reader_prompt_; |
| 65 std::unique_ptr<PDFWebContentsHelperClient> client_; | 67 std::unique_ptr<PDFWebContentsHelperClient> client_; |
| 66 | 68 |
| 67 DISALLOW_COPY_AND_ASSIGN(PDFWebContentsHelper); | 69 DISALLOW_COPY_AND_ASSIGN(PDFWebContentsHelper); |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 } // namespace pdf | 72 } // namespace pdf |
| 71 | 73 |
| 72 #endif // COMPONENTS_PDF_BROWSER_PDF_WEB_CONTENTS_HELPER_H_ | 74 #endif // COMPONENTS_PDF_BROWSER_PDF_WEB_CONTENTS_HELPER_H_ |
| OLD | NEW |