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_EXTENSION_TABS_MODULE_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "chrome/browser/extensions/extension_function.h" | 13 #include "chrome/browser/extensions/extension_function.h" |
14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
16 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 | 18 |
19 class BackingStore; | 19 class BackingStore; |
20 class Extension; | 20 class Extension; |
21 class GURL; | 21 class GURL; |
22 class SkBitmap; | 22 class SkBitmap; |
23 class TabContentsWrapper; | 23 class TabContentsWrapper; |
24 namespace base { | 24 namespace base { |
25 class DictionaryValue; | 25 class DictionaryValue; |
26 } // namespace base | 26 } // namespace base |
27 namespace content { | 27 namespace content { |
28 class WebContents; | 28 class WebContents; |
29 } // namespace content | 29 } // namespace content |
| 30 namespace skia { |
| 31 class PlatformCanvas; |
| 32 } // namespace skia |
30 | 33 |
31 // Windows | 34 // Windows |
32 class GetWindowFunction : public SyncExtensionFunction { | 35 class GetWindowFunction : public SyncExtensionFunction { |
33 virtual ~GetWindowFunction() {} | 36 virtual ~GetWindowFunction() {} |
34 virtual bool RunImpl() OVERRIDE; | 37 virtual bool RunImpl() OVERRIDE; |
35 DECLARE_EXTENSION_FUNCTION_NAME("windows.get") | 38 DECLARE_EXTENSION_FUNCTION_NAME("windows.get") |
36 }; | 39 }; |
37 class GetCurrentWindowFunction : public SyncExtensionFunction { | 40 class GetCurrentWindowFunction : public SyncExtensionFunction { |
38 virtual ~GetCurrentWindowFunction() {} | 41 virtual ~GetCurrentWindowFunction() {} |
39 virtual bool RunImpl() OVERRIDE; | 42 virtual bool RunImpl() OVERRIDE; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 177 |
175 virtual ~CaptureVisibleTabFunction() {} | 178 virtual ~CaptureVisibleTabFunction() {} |
176 virtual bool RunImpl() OVERRIDE; | 179 virtual bool RunImpl() OVERRIDE; |
177 virtual bool GetTabToCapture(content::WebContents** web_contents, | 180 virtual bool GetTabToCapture(content::WebContents** web_contents, |
178 TabContentsWrapper** wrapper); | 181 TabContentsWrapper** wrapper); |
179 virtual void Observe(int type, | 182 virtual void Observe(int type, |
180 const content::NotificationSource& source, | 183 const content::NotificationSource& source, |
181 const content::NotificationDetails& details) OVERRIDE; | 184 const content::NotificationDetails& details) OVERRIDE; |
182 void SendResultFromBitmap(const SkBitmap& screen_capture); | 185 void SendResultFromBitmap(const SkBitmap& screen_capture); |
183 | 186 |
| 187 private: |
| 188 void CopyFromBackingStoreComplete(skia::PlatformCanvas* canvas, |
| 189 bool succeeded); |
| 190 |
184 content::NotificationRegistrar registrar_; | 191 content::NotificationRegistrar registrar_; |
185 | 192 |
186 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). | 193 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). |
187 ImageFormat image_format_; | 194 ImageFormat image_format_; |
188 | 195 |
189 // Quality setting to use when encoding jpegs. Set in RunImpl(). | 196 // Quality setting to use when encoding jpegs. Set in RunImpl(). |
190 int image_quality_; | 197 int image_quality_; |
191 | 198 |
192 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") | 199 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") |
193 }; | 200 }; |
194 | 201 |
195 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ | 202 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ |
OLD | NEW |