| 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 CHROME_BROWSER_EXTENSIONS_API_PAGE_CAPTURE_PAGE_CAPTURE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PAGE_CAPTURE_PAGE_CAPTURE_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_PAGE_CAPTURE_PAGE_CAPTURE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_PAGE_CAPTURE_PAGE_CAPTURE_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 namespace extensions { | 23 namespace extensions { |
| 24 | 24 |
| 25 class PageCaptureSaveAsMHTMLFunction : public AsyncExtensionFunction { | 25 class PageCaptureSaveAsMHTMLFunction : public AsyncExtensionFunction { |
| 26 public: | 26 public: |
| 27 PageCaptureSaveAsMHTMLFunction(); | 27 PageCaptureSaveAsMHTMLFunction(); |
| 28 | 28 |
| 29 // Test specific delegate used to test that the temporary file gets deleted. | 29 // Test specific delegate used to test that the temporary file gets deleted. |
| 30 class TestDelegate { | 30 class TestDelegate { |
| 31 public: | 31 public: |
| 32 virtual ~TestDelegate() { } |
| 33 |
| 32 // Called on the UI thread when the temporary file that contains the | 34 // Called on the UI thread when the temporary file that contains the |
| 33 // generated data has been created. | 35 // generated data has been created. |
| 34 virtual void OnTemporaryFileCreated(const base::FilePath& temp_file) = 0; | 36 virtual void OnTemporaryFileCreated(const base::FilePath& temp_file) = 0; |
| 35 }; | 37 }; |
| 36 static void SetTestDelegate(TestDelegate* delegate); | 38 static void SetTestDelegate(TestDelegate* delegate); |
| 37 | 39 |
| 38 private: | 40 private: |
| 39 virtual ~PageCaptureSaveAsMHTMLFunction(); | 41 virtual ~PageCaptureSaveAsMHTMLFunction(); |
| 40 virtual bool RunImpl() OVERRIDE; | 42 virtual bool RunImpl() OVERRIDE; |
| 41 virtual bool OnMessageReceivedFromRenderView( | 43 virtual bool OnMessageReceivedFromRenderView( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 62 | 64 |
| 63 // The file containing the MHTML. | 65 // The file containing the MHTML. |
| 64 scoped_refptr<webkit_blob::ShareableFileReference> mhtml_file_; | 66 scoped_refptr<webkit_blob::ShareableFileReference> mhtml_file_; |
| 65 | 67 |
| 66 DECLARE_EXTENSION_FUNCTION("pageCapture.saveAsMHTML", PAGECAPTURE_SAVEASMHTML) | 68 DECLARE_EXTENSION_FUNCTION("pageCapture.saveAsMHTML", PAGECAPTURE_SAVEASMHTML) |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 } // namespace extensions | 71 } // namespace extensions |
| 70 | 72 |
| 71 #endif // CHROME_BROWSER_EXTENSIONS_API_PAGE_CAPTURE_PAGE_CAPTURE_API_H_ | 73 #endif // CHROME_BROWSER_EXTENSIONS_API_PAGE_CAPTURE_PAGE_CAPTURE_API_H_ |
| OLD | NEW |