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_DOM_UI_WEB_UI_SCREENSHOT_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_WEB_UI_SCREENSHOT_SOURCE_H_ |
6 #define CHROME_BROWSER_DOM_UI_WEB_UI_SCREENSHOT_SOURCE_H_ | 6 #define CHROME_BROWSER_DOM_UI_WEB_UI_SCREENSHOT_SOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 12 #include "chrome/browser/webui/chrome_url_data_manager.h" |
13 | 13 |
14 // ScreenshotSource is the data source that serves screenshots (saved | 14 // ScreenshotSource is the data source that serves screenshots (saved |
15 // or current) to the bug report html ui | 15 // or current) to the bug report html ui |
16 class WebUIScreenshotSource : public ChromeURLDataManager::DataSource { | 16 class WebUIScreenshotSource : public ChromeURLDataManager::DataSource { |
17 public: | 17 public: |
18 explicit WebUIScreenshotSource( | 18 explicit WebUIScreenshotSource( |
19 std::vector<unsigned char>* current_screenshot); | 19 std::vector<unsigned char>* current_screenshot); |
20 | 20 |
21 // Called when the network layer has requested a resource underneath | 21 // Called when the network layer has requested a resource underneath |
22 // the path we registered. | 22 // the path we registered. |
23 virtual void StartDataRequest(const std::string& path, | 23 virtual void StartDataRequest(const std::string& path, |
24 bool is_off_the_record, | 24 bool is_off_the_record, |
25 int request_id); | 25 int request_id); |
26 | 26 |
27 virtual std::string GetMimeType(const std::string&) const; | 27 virtual std::string GetMimeType(const std::string&) const; |
28 | 28 |
29 std::vector<unsigned char> GetScreenshot(const std::string& path); | 29 std::vector<unsigned char> GetScreenshot(const std::string& path); |
30 | 30 |
31 private: | 31 private: |
32 virtual ~WebUIScreenshotSource(); | 32 virtual ~WebUIScreenshotSource(); |
33 | 33 |
34 std::vector<unsigned char> current_screenshot_; | 34 std::vector<unsigned char> current_screenshot_; |
35 | 35 |
36 DISALLOW_COPY_AND_ASSIGN(WebUIScreenshotSource); | 36 DISALLOW_COPY_AND_ASSIGN(WebUIScreenshotSource); |
37 }; | 37 }; |
38 | 38 |
39 #endif // CHROME_BROWSER_DOM_UI_WEB_UI_SCREENSHOT_SOURCE_H_ | 39 #endif // CHROME_BROWSER_DOM_UI_WEB_UI_SCREENSHOT_SOURCE_H_ |
OLD | NEW |