Index: chrome/browser/extensions/extension_offscreen_tabs_module.h |
=================================================================== |
--- chrome/browser/extensions/extension_offscreen_tabs_module.h (revision 0) |
+++ chrome/browser/extensions/extension_offscreen_tabs_module.h (revision 0) |
@@ -0,0 +1,127 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_H__ |
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_H__ |
+#pragma once |
+ |
+#include <string> |
+ |
+#include "chrome/browser/extensions/extension_function.h" |
+#include "content/browser/tab_contents/tab_contents_observer.h" |
+#include "content/common/notification_observer.h" |
+#include "content/common/notification_registrar.h" |
+ |
+class BackingStore; |
+class Browser; |
+class SkBitmap; |
+class TabContents; |
+class TabContentsWrapper; |
+class TabStripModel; |
+ |
+namespace base { |
+class DictionaryValue; |
+class ListValue; |
+} |
+ |
+class OffscreenTabsEventManager : public NotificationObserver { |
+ public: |
+ OffscreenTabsEventManager(); |
+ virtual ~OffscreenTabsEventManager(); |
+ void RegisterForTabNotifications(const TabContents* contents); |
+ void UnregisterForTabNotifications(const TabContents* contents); |
+ private: |
+ virtual void Observe(const int type, |
+ const NotificationSource& source, |
+ const NotificationDetails& details); |
+ NotificationRegistrar registrar_; |
+}; |
+class CreateOffscreenTabFunction : public SyncExtensionFunction { |
+ public: |
+ CreateOffscreenTabFunction(); |
+ virtual ~CreateOffscreenTabFunction(); |
+ virtual bool RunImpl(); |
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.create") |
+}; |
+class GetOffscreenTabFunction : public SyncExtensionFunction { |
+ public: |
+ GetOffscreenTabFunction(); |
+ virtual ~GetOffscreenTabFunction(); |
+ virtual bool RunImpl(); |
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.get") |
+}; |
+class GetAllOffscreenTabFunction : public SyncExtensionFunction { |
+ public: |
+ GetAllOffscreenTabFunction(); |
+ virtual ~GetAllOffscreenTabFunction(); |
+ virtual bool RunImpl(); |
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.getAll") |
+}; |
+class RemoveOffscreenTabFunction : public SyncExtensionFunction { |
+ public: |
+ RemoveOffscreenTabFunction(); |
+ virtual ~RemoveOffscreenTabFunction(); |
+ virtual bool RunImpl(); |
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.remove") |
+}; |
+class SendKeyboardEventOffscreenTabFunction : public SyncExtensionFunction { |
+ public: |
+ SendKeyboardEventOffscreenTabFunction(); |
+ virtual ~SendKeyboardEventOffscreenTabFunction(); |
+ virtual bool RunImpl(); |
+ DECLARE_EXTENSION_FUNCTION_NAME( |
+ "experimental.offscreenTabs.sendKeyboardEvent") |
+}; |
+class SendMouseEventOffscreenTabFunction : public SyncExtensionFunction { |
+ public: |
+ SendMouseEventOffscreenTabFunction(); |
+ virtual ~SendMouseEventOffscreenTabFunction(); |
+ virtual bool RunImpl(); |
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.sendMouseEvent") |
+}; |
+class ToDataUrlOffscreenTabFunction : public AsyncExtensionFunction, |
+ public NotificationObserver { |
+ public: |
+ ToDataUrlOffscreenTabFunction(); |
+ virtual ~ToDataUrlOffscreenTabFunction(); |
+ virtual bool RunImpl(); |
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.toDataUrl") |
+ private: |
+ enum ImageFormat { |
+ FORMAT_JPEG, |
+ FORMAT_PNG |
+ }; |
+ |
+ // The default quality setting used when encoding jpegs. |
+ static const int kDefaultQuality; |
+ virtual bool CaptureSnapshotFromBackingStore(BackingStore* backing_store); |
+ virtual void Observe(const int type, |
+ const NotificationSource& source, |
+ const NotificationDetails& details); |
+ virtual void SendResultFromBitmap(const SkBitmap& screen_capture); |
+ |
+ NotificationRegistrar registrar_; |
+ |
+ // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). |
+ ImageFormat image_format_; |
+ |
+ // Quality setting to use when encoding jpegs. Set in RunImpl(). |
+ int image_quality_; |
+}; |
+class UpdateOffscreenTabFunction : public AsyncExtensionFunction, |
+ public TabContentsObserver { |
+ public: |
+ UpdateOffscreenTabFunction(); |
+ virtual ~UpdateOffscreenTabFunction(); |
+ virtual bool RunImpl(); |
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.update") |
+ private: |
+ virtual bool OnMessageReceived(const IPC::Message& message); |
+ void OnExecuteCodeFinished(int request_id, |
+ bool success, |
+ const std::string& error); |
+}; |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_H__ |
+ |
Property changes on: chrome/browser/extensions/extension_offscreen_tabs_module.h |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |