| 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 #include "chrome/browser/extensions/api/page_capture/page_capture_api.h" | 5 #include "chrome/browser/extensions/api/page_capture/page_capture_api.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 using extensions::PageCaptureSaveAsMHTMLFunction; | 25 using extensions::PageCaptureSaveAsMHTMLFunction; |
| 26 using webkit_blob::ShareableFileReference; | 26 using webkit_blob::ShareableFileReference; |
| 27 | 27 |
| 28 namespace SaveAsMHTML = extensions::api::page_capture::SaveAsMHTML; | 28 namespace SaveAsMHTML = extensions::api::page_capture::SaveAsMHTML; |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 const char kFileTooBigError[] = "The MHTML file generated is too big."; | 32 const char kFileTooBigError[] = "The MHTML file generated is too big."; |
| 33 const char kMHTMLGenerationFailedError[] = "Failed to generate MHTML."; | 33 const char kMHTMLGenerationFailedError[] = "Failed to generate MHTML."; |
| 34 const char kTemporaryFileError[] = "Failed to create a temporary file."; | 34 const char kTemporaryFileError[] = "Failed to create a temporary file."; |
| 35 const char kTabClosedError[] = "Cannot find the tab for thie request."; | 35 const char kTabClosedError[] = "Cannot find the tab for this request."; |
| 36 | 36 |
| 37 } // namespace | 37 } // namespace |
| 38 | 38 |
| 39 static PageCaptureSaveAsMHTMLFunction::TestDelegate* test_delegate_ = NULL; | 39 static PageCaptureSaveAsMHTMLFunction::TestDelegate* test_delegate_ = NULL; |
| 40 | 40 |
| 41 PageCaptureSaveAsMHTMLFunction::PageCaptureSaveAsMHTMLFunction() { | 41 PageCaptureSaveAsMHTMLFunction::PageCaptureSaveAsMHTMLFunction() { |
| 42 } | 42 } |
| 43 | 43 |
| 44 PageCaptureSaveAsMHTMLFunction::~PageCaptureSaveAsMHTMLFunction() { | 44 PageCaptureSaveAsMHTMLFunction::~PageCaptureSaveAsMHTMLFunction() { |
| 45 if (mhtml_file_.get()) { | 45 if (mhtml_file_.get()) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 GetProfile(), | 193 GetProfile(), |
| 194 include_incognito(), | 194 include_incognito(), |
| 195 &browser, | 195 &browser, |
| 196 NULL, | 196 NULL, |
| 197 &web_contents, | 197 &web_contents, |
| 198 NULL)) { | 198 NULL)) { |
| 199 return NULL; | 199 return NULL; |
| 200 } | 200 } |
| 201 return web_contents; | 201 return web_contents; |
| 202 } | 202 } |
| OLD | NEW |