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" |
11 #include "base/task.h" | 11 #include "base/task.h" |
12 #include "base/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/waitable_event.h" | 13 #include "base/waitable_event.h" |
14 #include "chrome/browser/browser_thread.h" | 14 #include "chrome/browser/browser_thread.h" |
15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
17 #include "gfx/codec/jpeg_codec.h" | 17 #include "gfx/codec/jpeg_codec.h" |
18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
19 #include "third_party/skia/include/core/SkBitmap.h" | 19 #include "third_party/skia/include/core/SkBitmap.h" |
20 | 20 |
21 static const char kCurrentScreenshot[] = "current"; | 21 static const char kCurrentScreenshot[] = "current"; |
22 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 118 |
119 std::string DOMUIScreenshotSource::GetMimeType(const std::string&) const { | 119 std::string DOMUIScreenshotSource::GetMimeType(const std::string&) const { |
120 // We need to explicitly return a mime type, otherwise if the user tries to | 120 // We need to explicitly return a mime type, otherwise if the user tries to |
121 // drag the image they get no extension. | 121 // drag the image they get no extension. |
122 return "image/png"; | 122 return "image/png"; |
123 } | 123 } |
OLD | NEW |