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

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

Issue 10837253: Allow /drive files in "Report Issue" page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 6b5e214606d067ca6390f0d693e5f20760eeeb7f..2e3e13915275df7ce52264a7e8edf4ad824f4e92 100644
--- a/chrome/browser/ui/webui/screenshot_source.h
+++ b/chrome/browser/ui/webui/screenshot_source.h
@@ -13,15 +13,24 @@
#include "base/memory/linked_ptr.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/gdata/gdata_errorcode.h"
+#include "chrome/browser/chromeos/gdata/gdata_files.h"
+#endif
+
typedef std::vector<unsigned char> ScreenshotData;
typedef linked_ptr<ScreenshotData> ScreenshotDataPtr;
+class FilePath;
+class Profile;
+
// ScreenshotSource is the data source that serves screenshots (saved
// or current) to the bug report html ui.
class ScreenshotSource : public ChromeURLDataManager::DataSource {
public:
explicit ScreenshotSource(
- std::vector<unsigned char>* current_screenshot);
+ std::vector<unsigned char>* current_screenshot,
+ Profile* profile);
// Called when the network layer has requested a resource underneath
// the path we registered.
@@ -47,7 +56,18 @@ class ScreenshotSource : public ChromeURLDataManager::DataSource {
#if defined(OS_CHROMEOS)
// Send a saved screenshot image file specified by the given screenshot path
// to the requestor.
- void SendSavedScreenshot(const std::string& screenshot_path, int request_id);
+ void SendSavedScreenshot(const std::string& screenshot_path,
+ int request_id,
+ const FilePath& file);
+
+ // The callback for GData's getting file method.
+ void GetSavedScreenshotCallback(const std::string& screenshot_path,
+ int request_id,
+ gdata::GDataFileError error,
+ const FilePath& file,
+ const std::string& unused_mime_type,
+ gdata::GDataFileType file_type);
+
#endif
// Sends the screenshot data to the requestor while caching it locally to the
// class instance, indexed by path.
@@ -58,6 +78,8 @@ class ScreenshotSource : public ChromeURLDataManager::DataSource {
// Pointer to the screenshot data for the current screenshot.
ScreenshotDataPtr current_screenshot_;
+ Profile* profile_;
+
// Key: Relative path to the screenshot (including filename)
// Value: Pointer to the screenshot data associated with the path.
std::map<std::string, ScreenshotDataPtr> cached_screenshots_;

Powered by Google App Engine
This is Rietveld 408576698