OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/screenshot_source.h" | 5 #include "chrome/browser/ui/webui/screenshot_source.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/task.h" | |
14 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
15 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
16 | 15 |
17 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
18 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
19 #endif | 18 #endif |
20 | 19 |
21 static const char kCurrentScreenshotFilename[] = "current"; | 20 static const char kCurrentScreenshotFilename[] = "current"; |
22 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
23 static const char kSavedScreenshotsBasePath[] = "saved/"; | 22 static const char kSavedScreenshotsBasePath[] = "saved/"; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 109 } |
111 #endif | 110 #endif |
112 | 111 |
113 void ScreenshotSource::CacheAndSendScreenshot( | 112 void ScreenshotSource::CacheAndSendScreenshot( |
114 const std::string& screenshot_path, | 113 const std::string& screenshot_path, |
115 int request_id, | 114 int request_id, |
116 ScreenshotDataPtr bytes) { | 115 ScreenshotDataPtr bytes) { |
117 cached_screenshots_[screenshot_path] = bytes; | 116 cached_screenshots_[screenshot_path] = bytes; |
118 SendResponse(request_id, new RefCountedBytes(*bytes)); | 117 SendResponse(request_id, new RefCountedBytes(*bytes)); |
119 } | 118 } |
OLD | NEW |