| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 const std::string& screenshot_path, | 94 const std::string& screenshot_path, |
| 95 const content::URLDataSource::GotDataCallback& callback, | 95 const content::URLDataSource::GotDataCallback& callback, |
| 96 const base::FilePath& file); | 96 const base::FilePath& file); |
| 97 | 97 |
| 98 // The callback for Drive's getting file method. | 98 // The callback for Drive's getting file method. |
| 99 void GetSavedScreenshotCallback( | 99 void GetSavedScreenshotCallback( |
| 100 const std::string& screenshot_path, | 100 const std::string& screenshot_path, |
| 101 const content::URLDataSource::GotDataCallback& callback, | 101 const content::URLDataSource::GotDataCallback& callback, |
| 102 drive::FileError error, | 102 drive::FileError error, |
| 103 const base::FilePath& file, | 103 const base::FilePath& file, |
| 104 const std::string& unused_mime_type, | 104 scoped_ptr<drive::ResourceEntry> entry); |
| 105 drive::DriveFileType file_type); | |
| 106 | 105 |
| 107 #endif | 106 #endif |
| 108 // Sends the screenshot data to the requestor while caching it locally to the | 107 // Sends the screenshot data to the requestor while caching it locally to the |
| 109 // class instance, indexed by path. | 108 // class instance, indexed by path. |
| 110 void CacheAndSendScreenshot( | 109 void CacheAndSendScreenshot( |
| 111 const std::string& screenshot_path, | 110 const std::string& screenshot_path, |
| 112 const content::URLDataSource::GotDataCallback& callback, | 111 const content::URLDataSource::GotDataCallback& callback, |
| 113 ScreenshotDataPtr bytes); | 112 ScreenshotDataPtr bytes); |
| 114 | 113 |
| 115 // Pointer to the screenshot data for the current screenshot. | 114 // Pointer to the screenshot data for the current screenshot. |
| 116 ScreenshotDataPtr current_screenshot_; | 115 ScreenshotDataPtr current_screenshot_; |
| 117 | 116 |
| 118 Profile* profile_; | 117 Profile* profile_; |
| 119 | 118 |
| 120 // Key: Relative path to the screenshot (including filename) | 119 // Key: Relative path to the screenshot (including filename) |
| 121 // Value: Pointer to the screenshot data associated with the path. | 120 // Value: Pointer to the screenshot data associated with the path. |
| 122 std::map<std::string, ScreenshotDataPtr> cached_screenshots_; | 121 std::map<std::string, ScreenshotDataPtr> cached_screenshots_; |
| 123 | 122 |
| 124 DISALLOW_COPY_AND_ASSIGN(ScreenshotSource); | 123 DISALLOW_COPY_AND_ASSIGN(ScreenshotSource); |
| 125 }; | 124 }; |
| 126 | 125 |
| 127 #endif // CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ | 126 #endif // CHROME_BROWSER_UI_WEBUI_SCREENSHOT_SOURCE_H_ |
| OLD | NEW |