Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: chrome/browser/ui/webui/screenshot_source.h

Issue 7635017: Fix saved screenshots for feedback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fix. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/screenshot_source.h
diff --git a/chrome/browser/ui/webui/screenshot_source.h b/chrome/browser/ui/webui/screenshot_source.h
index 4b071d3df0acf92a53068593cca4260e1f4625f2..0fa843291c378095109c8349e2031b845b82e4e7 100644
--- a/chrome/browser/ui/webui/screenshot_source.h
+++ b/chrome/browser/ui/webui/screenshot_source.h
@@ -5,12 +5,17 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_
#define CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_
+#include <map>
#include <string>
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/linked_ptr.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
+typedef std::vector<unsigned char> ScreenshotData;
+typedef linked_ptr<ScreenshotData> ScreenshotDataPtr;
+
// ScreenshotSource is the data source that serves screenshots (saved
// or current) to the bug report html ui
class ScreenshotSource : public ChromeURLDataManager::DataSource {
@@ -26,12 +31,23 @@ class ScreenshotSource : public ChromeURLDataManager::DataSource {
virtual std::string GetMimeType(const std::string&) const;
- std::vector<unsigned char> GetScreenshot(const std::string& path);
+ ScreenshotDataPtr GetCachedScreenshot(const std::string& path);
private:
virtual ~ScreenshotSource();
- std::vector<unsigned char> current_screenshot_;
+ // Sends the screenshot data to the requestor while caching it locally to the
+ // class instance, indexed by path.
+ void CacheAndSendScreenshot(const std::string& path,
+ int request_id,
+ ScreenshotDataPtr bytes);
+ void SendScreenshot(const std::string& path, int request_id);
+#if defined(OS_CHROMEOS)
+ void SendSavedScreenshot(const std::string& filename, int request_id);
Daniel Erat 2011/08/22 16:42:02 headers should have comments describing what funct
rkc 2011/08/23 10:25:20 Done.
+#endif
+
+ ScreenshotDataPtr current_screenshot_;
+ std::map<std::string, ScreenshotDataPtr> cached_screenshots_;
Daniel Erat 2011/08/22 16:42:02 add a comment here describing what you're using as
rkc 2011/08/23 10:25:20 Done.
DISALLOW_COPY_AND_ASSIGN(ScreenshotSource);
};

Powered by Google App Engine
This is Rietveld 408576698