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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 DOMUIScreenshotSource::DOMUIScreenshotSource( | 101 DOMUIScreenshotSource::DOMUIScreenshotSource( |
102 std::vector<unsigned char>* current_screenshot) | 102 std::vector<unsigned char>* current_screenshot) |
103 : DataSource(chrome::kChromeUIScreenshotPath, MessageLoop::current()) { | 103 : DataSource(chrome::kChromeUIScreenshotPath, MessageLoop::current()) { |
104 // Setup the last screenshot taken. | 104 // Setup the last screenshot taken. |
105 if (current_screenshot) | 105 if (current_screenshot) |
106 current_screenshot_ = *current_screenshot; | 106 current_screenshot_ = *current_screenshot; |
107 else | 107 else |
108 current_screenshot_.clear(); | 108 current_screenshot_.clear(); |
109 } | 109 } |
110 | 110 |
| 111 DOMUIScreenshotSource::~DOMUIScreenshotSource() {} |
| 112 |
111 void DOMUIScreenshotSource::StartDataRequest(const std::string& path, | 113 void DOMUIScreenshotSource::StartDataRequest(const std::string& path, |
112 bool is_off_the_record, | 114 bool is_off_the_record, |
113 int request_id) { | 115 int request_id) { |
114 SendResponse(request_id, new RefCountedBytes(GetScreenshot(path))); | 116 SendResponse(request_id, new RefCountedBytes(GetScreenshot(path))); |
115 } | 117 } |
OLD | NEW |