| 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_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 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 virtual ~RemoveTabFunction() {} | 138 virtual ~RemoveTabFunction() {} |
| 139 virtual bool RunImpl(); | 139 virtual bool RunImpl(); |
| 140 DECLARE_EXTENSION_FUNCTION_NAME("tabs.remove") | 140 DECLARE_EXTENSION_FUNCTION_NAME("tabs.remove") |
| 141 }; | 141 }; |
| 142 class DetectTabLanguageFunction : public AsyncExtensionFunction, | 142 class DetectTabLanguageFunction : public AsyncExtensionFunction, |
| 143 public NotificationObserver { | 143 public NotificationObserver { |
| 144 private: | 144 private: |
| 145 virtual ~DetectTabLanguageFunction() {} | 145 virtual ~DetectTabLanguageFunction() {} |
| 146 virtual bool RunImpl(); | 146 virtual bool RunImpl(); |
| 147 | 147 |
| 148 virtual void Observe(NotificationType type, | 148 virtual void Observe(int type, |
| 149 const NotificationSource& source, | 149 const NotificationSource& source, |
| 150 const NotificationDetails& details); | 150 const NotificationDetails& details); |
| 151 void GotLanguage(const std::string& language); | 151 void GotLanguage(const std::string& language); |
| 152 NotificationRegistrar registrar_; | 152 NotificationRegistrar registrar_; |
| 153 DECLARE_EXTENSION_FUNCTION_NAME("tabs.detectLanguage") | 153 DECLARE_EXTENSION_FUNCTION_NAME("tabs.detectLanguage") |
| 154 }; | 154 }; |
| 155 class CaptureVisibleTabFunction : public AsyncExtensionFunction, | 155 class CaptureVisibleTabFunction : public AsyncExtensionFunction, |
| 156 public NotificationObserver { | 156 public NotificationObserver { |
| 157 private: | 157 private: |
| 158 enum ImageFormat { | 158 enum ImageFormat { |
| 159 FORMAT_JPEG, | 159 FORMAT_JPEG, |
| 160 FORMAT_PNG | 160 FORMAT_PNG |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 // The default quality setting used when encoding jpegs. | 163 // The default quality setting used when encoding jpegs. |
| 164 static const int kDefaultQuality; | 164 static const int kDefaultQuality; |
| 165 | 165 |
| 166 virtual ~CaptureVisibleTabFunction() {} | 166 virtual ~CaptureVisibleTabFunction() {} |
| 167 virtual bool RunImpl(); | 167 virtual bool RunImpl(); |
| 168 virtual bool CaptureSnapshotFromBackingStore(BackingStore* backing_store); | 168 virtual bool CaptureSnapshotFromBackingStore(BackingStore* backing_store); |
| 169 virtual void Observe(NotificationType type, | 169 virtual void Observe(int type, |
| 170 const NotificationSource& source, | 170 const NotificationSource& source, |
| 171 const NotificationDetails& details); | 171 const NotificationDetails& details); |
| 172 virtual void SendResultFromBitmap(const SkBitmap& screen_capture); | 172 virtual void SendResultFromBitmap(const SkBitmap& screen_capture); |
| 173 | 173 |
| 174 NotificationRegistrar registrar_; | 174 NotificationRegistrar registrar_; |
| 175 | 175 |
| 176 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). | 176 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). |
| 177 ImageFormat image_format_; | 177 ImageFormat image_format_; |
| 178 | 178 |
| 179 // Quality setting to use when encoding jpegs. Set in RunImpl(). | 179 // Quality setting to use when encoding jpegs. Set in RunImpl(). |
| 180 int image_quality_; | 180 int image_quality_; |
| 181 | 181 |
| 182 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") | 182 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ | 185 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ |
| OLD | NEW |