| OLD | NEW |
| 1 // Copyright (c) 2011 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 #include "chrome/browser/extensions/extension_page_capture_api.h" | 5 #include "chrome/browser/extensions/extension_page_capture_api.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/extension_tab_util.h" | 10 #include "chrome/browser/extensions/extension_tab_util.h" |
| 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 12 #include "chrome/common/extensions/extension_messages.h" | 12 #include "chrome/common/extensions/extension_messages.h" |
| 13 #include "content/browser/child_process_security_policy.h" | |
| 14 #include "content/browser/renderer_host/render_view_host.h" | 13 #include "content/browser/renderer_host/render_view_host.h" |
| 15 #include "content/browser/download/mhtml_generation_manager.h" | 14 #include "content/browser/download/mhtml_generation_manager.h" |
| 15 #include "content/public/browser/child_process_security_policy.h" |
| 16 #include "content/public/browser/notification_details.h" | 16 #include "content/public/browser/notification_details.h" |
| 17 #include "content/public/browser/notification_source.h" | 17 #include "content/public/browser/notification_source.h" |
| 18 #include "content/public/browser/notification_types.h" | 18 #include "content/public/browser/notification_types.h" |
| 19 #include "content/public/browser/render_process_host.h" | 19 #include "content/public/browser/render_process_host.h" |
| 20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 21 | 21 |
| 22 using content::BrowserThread; | 22 using content::BrowserThread; |
| 23 using content::ChildProcessSecurityPolicy; |
| 23 using content::WebContents; | 24 using content::WebContents; |
| 24 | 25 |
| 25 // Error messages. | 26 // Error messages. |
| 26 const char* const kFileTooBigError = "The MHTML file generated is too big."; | 27 const char* const kFileTooBigError = "The MHTML file generated is too big."; |
| 27 const char* const kMHTMLGenerationFailedError = "Failed to generate MHTML."; | 28 const char* const kMHTMLGenerationFailedError = "Failed to generate MHTML."; |
| 28 const char* const kSizeRetrievalError = | 29 const char* const kSizeRetrievalError = |
| 29 "Failed to retrieve size of generated MHTML."; | 30 "Failed to retrieve size of generated MHTML."; |
| 30 const char* const kTemporaryFileError = "Failed to create a temporary file."; | 31 const char* const kTemporaryFileError = "Failed to create a temporary file."; |
| 31 const char* const kTabClosedError = "Cannot find the tab for thie request."; | 32 const char* const kTabClosedError = "Cannot find the tab for thie request."; |
| 32 | 33 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 WebContents* PageCaptureSaveAsMHTMLFunction::GetWebContents() { | 172 WebContents* PageCaptureSaveAsMHTMLFunction::GetWebContents() { |
| 172 Browser* browser = NULL; | 173 Browser* browser = NULL; |
| 173 TabContentsWrapper* tab_contents_wrapper = NULL; | 174 TabContentsWrapper* tab_contents_wrapper = NULL; |
| 174 | 175 |
| 175 if (!ExtensionTabUtil::GetTabById(tab_id_, profile(), include_incognito(), | 176 if (!ExtensionTabUtil::GetTabById(tab_id_, profile(), include_incognito(), |
| 176 &browser, NULL, &tab_contents_wrapper, NULL)) { | 177 &browser, NULL, &tab_contents_wrapper, NULL)) { |
| 177 return NULL; | 178 return NULL; |
| 178 } | 179 } |
| 179 return tab_contents_wrapper->web_contents(); | 180 return tab_contents_wrapper->web_contents(); |
| 180 } | 181 } |
| OLD | NEW |