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/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_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/i18n/time_formatting.h" | 11 #include "base/i18n/time_formatting.h" |
12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/prefs/pref_service.h" |
15 #include "base/string16.h" | 16 #include "base/string16.h" |
| 17 #include "base/string_util.h" |
16 #include "base/stringprintf.h" | 18 #include "base/stringprintf.h" |
17 #include "base/string_util.h" | |
18 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/download/download_prefs.h" | 20 #include "chrome/browser/download/download_prefs.h" |
20 #include "chrome/browser/prefs/pref_service.h" | |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/profiles/profile_manager.h" | 22 #include "chrome/browser/profiles/profile_manager.h" |
23 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
24 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
25 #include "chrome/common/url_constants.h" | 25 #include "chrome/common/url_constants.h" |
26 #include "googleurl/src/url_canon.h" | 26 #include "googleurl/src/url_canon.h" |
27 #include "googleurl/src/url_util.h" | 27 #include "googleurl/src/url_util.h" |
28 | 28 |
29 #if defined(USE_ASH) | 29 #if defined(USE_ASH) |
30 #include "ash/shell.h" | 30 #include "ash/shell.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 void ScreenshotSource::CacheAndSendScreenshot( | 262 void ScreenshotSource::CacheAndSendScreenshot( |
263 const std::string& screenshot_path, | 263 const std::string& screenshot_path, |
264 const content::URLDataSource::GotDataCallback& callback, | 264 const content::URLDataSource::GotDataCallback& callback, |
265 ScreenshotDataPtr bytes) { | 265 ScreenshotDataPtr bytes) { |
266 // Strip the query from the screenshot path. | 266 // Strip the query from the screenshot path. |
267 std::string path = screenshot_path.substr( | 267 std::string path = screenshot_path.substr( |
268 0, screenshot_path.find_first_of("?")); | 268 0, screenshot_path.find_first_of("?")); |
269 cached_screenshots_[path] = bytes; | 269 cached_screenshots_[path] = bytes; |
270 callback.Run(new base::RefCountedBytes(*bytes)); | 270 callback.Run(new base::RefCountedBytes(*bytes)); |
271 } | 271 } |
OLD | NEW |