| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 to_release->AddRef(); | 47 to_release->AddRef(); |
| 48 mhtml_file_ = NULL; | 48 mhtml_file_ = NULL; |
| 49 BrowserThread::ReleaseSoon(BrowserThread::IO, FROM_HERE, to_release); | 49 BrowserThread::ReleaseSoon(BrowserThread::IO, FROM_HERE, to_release); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 void PageCaptureSaveAsMHTMLFunction::SetTestDelegate(TestDelegate* delegate) { | 53 void PageCaptureSaveAsMHTMLFunction::SetTestDelegate(TestDelegate* delegate) { |
| 54 test_delegate_ = delegate; | 54 test_delegate_ = delegate; |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool PageCaptureSaveAsMHTMLFunction::RunImpl() { | 57 bool PageCaptureSaveAsMHTMLFunction::RunAsync() { |
| 58 params_ = SaveAsMHTML::Params::Create(*args_); | 58 params_ = SaveAsMHTML::Params::Create(*args_); |
| 59 EXTENSION_FUNCTION_VALIDATE(params_.get()); | 59 EXTENSION_FUNCTION_VALIDATE(params_.get()); |
| 60 | 60 |
| 61 AddRef(); // Balanced in ReturnFailure/ReturnSuccess() | 61 AddRef(); // Balanced in ReturnFailure/ReturnSuccess() |
| 62 | 62 |
| 63 BrowserThread::PostTask( | 63 BrowserThread::PostTask( |
| 64 BrowserThread::FILE, FROM_HERE, | 64 BrowserThread::FILE, FROM_HERE, |
| 65 base::Bind(&PageCaptureSaveAsMHTMLFunction::CreateTemporaryFile, this)); | 65 base::Bind(&PageCaptureSaveAsMHTMLFunction::CreateTemporaryFile, this)); |
| 66 return true; | 66 return true; |
| 67 } | 67 } |
| (...skipping 125 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 |