| 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 #ifndef CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 static bool GetScreenshotDirectory(base::FilePath* directory); | 46 static bool GetScreenshotDirectory(base::FilePath* directory); |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 // Get the basefilename for screenshots | 49 // Get the basefilename for screenshots |
| 50 static std::string GetScreenshotBaseFilename(); | 50 static std::string GetScreenshotBaseFilename(); |
| 51 | 51 |
| 52 // content::URLDataSource implementation. | 52 // content::URLDataSource implementation. |
| 53 virtual std::string GetSource() OVERRIDE; | 53 virtual std::string GetSource() OVERRIDE; |
| 54 virtual void StartDataRequest( | 54 virtual void StartDataRequest( |
| 55 const std::string& path, | 55 const std::string& path, |
| 56 bool is_incognito, | 56 const content::URLDataSource::ExtraRequestInfo& info, |
| 57 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; | 57 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; |
| 58 virtual std::string GetMimeType(const std::string&) const OVERRIDE; | 58 virtual std::string GetMimeType(const std::string&) const OVERRIDE; |
| 59 | 59 |
| 60 // Get the screenshot specified by the given relative path that we've cached | 60 // Get the screenshot specified by the given relative path that we've cached |
| 61 // from a previous request to the screenshots source. | 61 // from a previous request to the screenshots source. |
| 62 // Note: This method strips the query string from the given path. | 62 // Note: This method strips the query string from the given path. |
| 63 ScreenshotDataPtr GetCachedScreenshot(const std::string& screenshot_path); | 63 ScreenshotDataPtr GetCachedScreenshot(const std::string& screenshot_path); |
| 64 | 64 |
| 65 // Url that represents the base directory for screenshots. | 65 // Url that represents the base directory for screenshots. |
| 66 static const char kScreenshotUrlRoot[]; | 66 static const char kScreenshotUrlRoot[]; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 Profile* profile_; | 117 Profile* profile_; |
| 118 | 118 |
| 119 // Key: Relative path to the screenshot (including filename) | 119 // Key: Relative path to the screenshot (including filename) |
| 120 // Value: Pointer to the screenshot data associated with the path. | 120 // Value: Pointer to the screenshot data associated with the path. |
| 121 std::map<std::string, ScreenshotDataPtr> cached_screenshots_; | 121 std::map<std::string, ScreenshotDataPtr> cached_screenshots_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(ScreenshotSource); | 123 DISALLOW_COPY_AND_ASSIGN(ScreenshotSource); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 #endif // CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ | 126 #endif // CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ |
| OLD | NEW |