| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_API_TABS_TABS_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 enum ImageFormat { | 178 enum ImageFormat { |
| 179 FORMAT_JPEG, | 179 FORMAT_JPEG, |
| 180 FORMAT_PNG | 180 FORMAT_PNG |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 // The default quality setting used when encoding jpegs. | 183 // The default quality setting used when encoding jpegs. |
| 184 static const int kDefaultQuality; | 184 static const int kDefaultQuality; |
| 185 | 185 |
| 186 virtual ~CaptureVisibleTabFunction() {} | 186 virtual ~CaptureVisibleTabFunction() {} |
| 187 virtual bool RunImpl() OVERRIDE; | 187 virtual bool RunImpl() OVERRIDE; |
| 188 virtual bool GetTabToCapture(content::WebContents** web_contents, | 188 virtual bool GetTabToCapture(content::WebContents** web_contents); |
| 189 TabContents** tab_contents); | |
| 190 virtual void Observe(int type, | 189 virtual void Observe(int type, |
| 191 const content::NotificationSource& source, | 190 const content::NotificationSource& source, |
| 192 const content::NotificationDetails& details) OVERRIDE; | 191 const content::NotificationDetails& details) OVERRIDE; |
| 193 void SendResultFromBitmap(const SkBitmap& screen_capture); | 192 void SendResultFromBitmap(const SkBitmap& screen_capture); |
| 194 | 193 |
| 195 private: | 194 private: |
| 196 void CopyFromBackingStoreComplete(skia::PlatformCanvas* canvas, | 195 void CopyFromBackingStoreComplete(skia::PlatformCanvas* canvas, |
| 197 bool succeeded); | 196 bool succeeded); |
| 198 | 197 |
| 199 content::NotificationRegistrar registrar_; | 198 content::NotificationRegistrar registrar_; |
| 200 | 199 |
| 201 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). | 200 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). |
| 202 ImageFormat image_format_; | 201 ImageFormat image_format_; |
| 203 | 202 |
| 204 // Quality setting to use when encoding jpegs. Set in RunImpl(). | 203 // Quality setting to use when encoding jpegs. Set in RunImpl(). |
| 205 int image_quality_; | 204 int image_quality_; |
| 206 | 205 |
| 207 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") | 206 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") |
| 208 }; | 207 }; |
| 209 | 208 |
| 210 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_H__ | 209 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_H__ |
| OLD | NEW |