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

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..57d619f6dce6cd6499f46f9ebc191ae6cb51d206 100644
--- a/chrome/browser/ui/webui/screenshot_source.h
+++ b/chrome/browser/ui/webui/screenshot_source.h
@@ -10,18 +10,27 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/file_path.h"
kinaba 2012/08/15 08:19:57 Forward declaration looks sufficient.
Jun Mukai 2012/08/15 08:30:42 Done.
#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 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.
@@ -48,6 +57,16 @@ class ScreenshotSource : public ChromeURLDataManager::DataSource {
// 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);
+
+ // The actual task of sending a saved screenshot image file. It's separated
+ // from SendSavedScreenshot to deal with the case that the download path is
+ // under Google Drive.
+ void SendSavedScreenshotInternal(const std::string& screenshot_path,
+ int request_id,
+ gdata::GDataFileError error,
+ const FilePath& file,
+ const std::string& 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 +77,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