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 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "chrome/browser/extensions/extension_function.h" | 12 #include "chrome/browser/extensions/extension_function.h" |
13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
16 | 16 |
17 class BackingStore; | 17 class BackingStore; |
18 class GURL; | 18 class GURL; |
| 19 class PrefService; |
19 class SkBitmap; | 20 class SkBitmap; |
20 class TabContents; | 21 class TabContents; |
21 | 22 |
22 namespace base { | 23 namespace base { |
23 class DictionaryValue; | 24 class DictionaryValue; |
24 } | 25 } |
25 | 26 |
26 namespace content { | 27 namespace content { |
27 class WebContents; | 28 class WebContents; |
28 } | 29 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 159 |
159 virtual void Observe(int type, | 160 virtual void Observe(int type, |
160 const content::NotificationSource& source, | 161 const content::NotificationSource& source, |
161 const content::NotificationDetails& details) OVERRIDE; | 162 const content::NotificationDetails& details) OVERRIDE; |
162 void GotLanguage(const std::string& language); | 163 void GotLanguage(const std::string& language); |
163 content::NotificationRegistrar registrar_; | 164 content::NotificationRegistrar registrar_; |
164 DECLARE_EXTENSION_FUNCTION_NAME("tabs.detectLanguage") | 165 DECLARE_EXTENSION_FUNCTION_NAME("tabs.detectLanguage") |
165 }; | 166 }; |
166 class CaptureVisibleTabFunction : public AsyncExtensionFunction, | 167 class CaptureVisibleTabFunction : public AsyncExtensionFunction, |
167 public content::NotificationObserver { | 168 public content::NotificationObserver { |
| 169 public: |
| 170 static void RegisterUserPrefs(PrefService* service); |
| 171 |
168 protected: | 172 protected: |
169 enum ImageFormat { | 173 enum ImageFormat { |
170 FORMAT_JPEG, | 174 FORMAT_JPEG, |
171 FORMAT_PNG | 175 FORMAT_PNG |
172 }; | 176 }; |
173 | 177 |
174 // The default quality setting used when encoding jpegs. | 178 // The default quality setting used when encoding jpegs. |
175 static const int kDefaultQuality; | 179 static const int kDefaultQuality; |
176 | 180 |
177 virtual ~CaptureVisibleTabFunction() {} | 181 virtual ~CaptureVisibleTabFunction() {} |
(...skipping 14 matching lines...) Expand all Loading... |
192 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). | 196 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). |
193 ImageFormat image_format_; | 197 ImageFormat image_format_; |
194 | 198 |
195 // Quality setting to use when encoding jpegs. Set in RunImpl(). | 199 // Quality setting to use when encoding jpegs. Set in RunImpl(). |
196 int image_quality_; | 200 int image_quality_; |
197 | 201 |
198 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") | 202 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") |
199 }; | 203 }; |
200 | 204 |
201 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_H__ | 205 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_H__ |
OLD | NEW |