OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/extensions/extension_save_page_api.h" | 5 #include "chrome/browser/extensions/extension_save_page_api.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/extensions/extension_tab_util.h" | 9 #include "chrome/browser/extensions/extension_tab_util.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
11 #include "content/browser/child_process_security_policy.h" | 11 #include "content/browser/child_process_security_policy.h" |
12 #include "content/browser/renderer_host/render_view_host.h" | 12 #include "content/browser/renderer_host/render_view_host.h" |
13 #include "content/browser/tab_contents/tab_contents.h" | 13 #include "content/browser/tab_contents/tab_contents.h" |
14 #include "content/browser/download/mhtml_generation_manager.h" | 14 #include "content/browser/download/mhtml_generation_manager.h" |
15 #include "content/common/notification_service.h" | 15 #include "content/public/browser/notification_details.h" |
| 16 #include "content/public/browser/notification_source.h" |
16 #include "content/public/browser/notification_types.h" | 17 #include "content/public/browser/notification_types.h" |
17 | 18 |
18 // Error messages. | 19 // Error messages. |
19 const char* const kFileTooBigError = "The MHTML file generated is too big."; | 20 const char* const kFileTooBigError = "The MHTML file generated is too big."; |
20 const char* const kMHTMLGenerationFailedError = "Failed to generate MHTML."; | 21 const char* const kMHTMLGenerationFailedError = "Failed to generate MHTML."; |
21 const char* const kSizeRetrievalError = | 22 const char* const kSizeRetrievalError = |
22 "Failed to retrieve size of generated MHTML."; | 23 "Failed to retrieve size of generated MHTML."; |
23 const char* const kTemporaryFileError = "Failed to create a temporary file."; | 24 const char* const kTemporaryFileError = "Failed to create a temporary file."; |
24 const char* const kTabClosedError = "Cannot find the tab for thie request."; | 25 const char* const kTabClosedError = "Cannot find the tab for thie request."; |
25 | 26 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 128 |
128 DictionaryValue* dict = new DictionaryValue(); | 129 DictionaryValue* dict = new DictionaryValue(); |
129 result_.reset(dict); | 130 result_.reset(dict); |
130 dict->SetString("mhtmlFilePath", mhtml_path_.value()); | 131 dict->SetString("mhtmlFilePath", mhtml_path_.value()); |
131 dict->SetInteger("mhtmlFileLength", file_size); | 132 dict->SetInteger("mhtmlFileLength", file_size); |
132 | 133 |
133 SendResponse(true); | 134 SendResponse(true); |
134 | 135 |
135 Release(); // Balanced in Run() | 136 Release(); // Balanced in Run() |
136 } | 137 } |
OLD | NEW |