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 11 matching lines...) Expand all Loading... |
22 typedef std::vector<unsigned char> ScreenshotData; | 22 typedef std::vector<unsigned char> ScreenshotData; |
23 typedef linked_ptr<ScreenshotData> ScreenshotDataPtr; | 23 typedef linked_ptr<ScreenshotData> ScreenshotDataPtr; |
24 | 24 |
25 class FilePath; | 25 class FilePath; |
26 class Profile; | 26 class Profile; |
27 | 27 |
28 // ScreenshotSource is the data source that serves screenshots (saved | 28 // ScreenshotSource is the data source that serves screenshots (saved |
29 // or current) to the bug report html ui. | 29 // or current) to the bug report html ui. |
30 class ScreenshotSource : public ChromeURLDataManager::DataSource { | 30 class ScreenshotSource : public ChromeURLDataManager::DataSource { |
31 public: | 31 public: |
32 explicit ScreenshotSource( | 32 ScreenshotSource( |
33 std::vector<unsigned char>* current_screenshot, | 33 std::vector<unsigned char>* current_screenshot, |
34 Profile* profile); | 34 Profile* profile); |
35 | 35 |
36 #if defined(USE_ASH) | 36 #if defined(USE_ASH) |
37 | 37 |
38 // Queries the browser process to determine if screenshots are disabled. | 38 // Queries the browser process to determine if screenshots are disabled. |
39 static bool AreScreenshotsDisabled(); | 39 static bool AreScreenshotsDisabled(); |
40 | 40 |
41 // Common access for the screenshot directory, parameter is set to the | 41 // Common access for the screenshot directory, parameter is set to the |
42 // requested directory and return value of true is given upon success. | 42 // requested directory and return value of true is given upon success. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 Profile* profile_; | 110 Profile* profile_; |
111 | 111 |
112 // Key: Relative path to the screenshot (including filename) | 112 // Key: Relative path to the screenshot (including filename) |
113 // Value: Pointer to the screenshot data associated with the path. | 113 // Value: Pointer to the screenshot data associated with the path. |
114 std::map<std::string, ScreenshotDataPtr> cached_screenshots_; | 114 std::map<std::string, ScreenshotDataPtr> cached_screenshots_; |
115 | 115 |
116 DISALLOW_COPY_AND_ASSIGN(ScreenshotSource); | 116 DISALLOW_COPY_AND_ASSIGN(ScreenshotSource); |
117 }; | 117 }; |
118 | 118 |
119 #endif // CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ | 119 #endif // CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ |
OLD | NEW |