| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/dom_ui/dom_ui_screenshot_source.h" | 5 #include "chrome/browser/dom_ui/dom_ui_screenshot_source.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/ref_counted_memory.h" | 10 #include "base/ref_counted_memory.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 current_screenshot_.clear(); | 108 current_screenshot_.clear(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 DOMUIScreenshotSource::~DOMUIScreenshotSource() {} | 111 DOMUIScreenshotSource::~DOMUIScreenshotSource() {} |
| 112 | 112 |
| 113 void DOMUIScreenshotSource::StartDataRequest(const std::string& path, | 113 void DOMUIScreenshotSource::StartDataRequest(const std::string& path, |
| 114 bool is_off_the_record, | 114 bool is_off_the_record, |
| 115 int request_id) { | 115 int request_id) { |
| 116 SendResponse(request_id, new RefCountedBytes(GetScreenshot(path))); | 116 SendResponse(request_id, new RefCountedBytes(GetScreenshot(path))); |
| 117 } | 117 } |
| 118 |
| 119 std::string DOMUIScreenshotSource::GetMimeType(const std::string&) const { |
| 120 // We need to explicitly return a mime type, otherwise if the user tries to |
| 121 // drag the image they get no extension. |
| 122 return "image/png"; |
| 123 } |
| OLD | NEW |