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" |
11 #include "chrome/browser/extensions/extension_function.h" | 11 #include "chrome/browser/extensions/extension_function.h" |
| 12 #include "chrome/common/extensions/api/page_capture.h" |
12 #include "webkit/blob/shareable_file_reference.h" | 13 #include "webkit/blob/shareable_file_reference.h" |
13 | 14 |
14 class FilePath; | 15 class FilePath; |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 class WebContents; | 18 class WebContents; |
18 } | 19 } |
19 | 20 |
20 namespace extensions { | 21 namespace extensions { |
21 | 22 |
(...skipping 23 matching lines...) Expand all Loading... |
45 void TemporaryFileCreated(bool success); | 46 void TemporaryFileCreated(bool success); |
46 void ReturnFailure(const std::string& error); | 47 void ReturnFailure(const std::string& error); |
47 void ReturnSuccess(int64 file_size); | 48 void ReturnSuccess(int64 file_size); |
48 | 49 |
49 // Callback called once the MHTML generation is done. | 50 // Callback called once the MHTML generation is done. |
50 void MHTMLGenerated(const FilePath& file_path, int64 mhtml_file_size); | 51 void MHTMLGenerated(const FilePath& file_path, int64 mhtml_file_size); |
51 | 52 |
52 // Returns the WebContents we are associated with, NULL if it's been closed. | 53 // Returns the WebContents we are associated with, NULL if it's been closed. |
53 content::WebContents* GetWebContents(); | 54 content::WebContents* GetWebContents(); |
54 | 55 |
55 int tab_id_; | 56 scoped_ptr<extensions::api::page_capture::SaveAsMHTML::Params> params_; |
56 | 57 |
57 // The path to the temporary file containing the MHTML data. | 58 // The path to the temporary file containing the MHTML data. |
58 FilePath mhtml_path_; | 59 FilePath mhtml_path_; |
59 | 60 |
60 // The file containing the MHTML. | 61 // The file containing the MHTML. |
61 scoped_refptr<webkit_blob::ShareableFileReference> mhtml_file_; | 62 scoped_refptr<webkit_blob::ShareableFileReference> mhtml_file_; |
62 | 63 |
63 DECLARE_EXTENSION_FUNCTION_NAME("pageCapture.saveAsMHTML") | 64 DECLARE_EXTENSION_FUNCTION_NAME("pageCapture.saveAsMHTML") |
64 }; | 65 }; |
65 | 66 |
66 } // namespace extensions | 67 } // namespace extensions |
67 | 68 |
68 #endif // CHROME_BROWSER_EXTENSIONS_API_PAGE_CAPTURE_PAGE_CAPTURE_API_H_ | 69 #endif // CHROME_BROWSER_EXTENSIONS_API_PAGE_CAPTURE_PAGE_CAPTURE_API_H_ |
OLD | NEW |