Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1473)

Unified Diff: chrome/browser/extensions/extension_offscreen_tabs_module.h

Issue 7720002: Chrome Extensions chrome.experimental.offscreenTabs.* API implementation, docs, and test. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,114 @@
+// 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:
+ 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 {
+ virtual ~CreateOffscreenTabFunction() {}
Ken Russell (switch to Gerrit) 2011/08/23 22:46:53 Virtual function definitions in headers, in partic
alexbost 2011/08/24 20:06:21 Done.
+ virtual bool RunImpl();
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.create")
+};
+class GetOffscreenTabFunction : public SyncExtensionFunction {
+ virtual ~GetOffscreenTabFunction() {}
+ virtual bool RunImpl();
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.get")
+};
+class GetAllOffscreenTabFunction : public SyncExtensionFunction {
+ virtual ~GetAllOffscreenTabFunction() {}
+ virtual bool RunImpl();
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.getAll")
+};
+class RemoveOffscreenTabFunction : public SyncExtensionFunction {
+ virtual ~RemoveOffscreenTabFunction() {}
+ virtual bool RunImpl();
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.remove")
+};
+class SendKeyboardEventOffscreenTabFunction : public SyncExtensionFunction {
+ virtual ~SendKeyboardEventOffscreenTabFunction() {}
+ virtual bool RunImpl();
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "experimental.offscreenTabs.sendKeyboardEvent")
+};
+class SendMouseEventOffscreenTabFunction : public SyncExtensionFunction {
+ virtual ~SendMouseEventOffscreenTabFunction() {}
+ virtual bool RunImpl();
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.sendMouseEvent")
+};
+class ToDataUrlOffscreenTabFunction : public AsyncExtensionFunction,
+ public NotificationObserver {
+ private:
+ enum ImageFormat {
+ FORMAT_JPEG,
+ FORMAT_PNG
+ };
+
+ // The default quality setting used when encoding jpegs.
+ static const int kDefaultQuality;
+
+ virtual ~ToDataUrlOffscreenTabFunction() {}
+ virtual bool RunImpl();
+ 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_;
+
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.toDataUrl")
+};
+class UpdateOffscreenTabFunction : public AsyncExtensionFunction,
+ public TabContentsObserver {
+ public:
+ UpdateOffscreenTabFunction();
+ private:
+ virtual ~UpdateOffscreenTabFunction() {}
+ virtual bool RunImpl();
+ virtual bool OnMessageReceived(const IPC::Message& message);
+ void OnExecuteCodeFinished(int request_id,
+ bool success,
+ const std::string& error);
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.update")
+};
+
+#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

Powered by Google App Engine
This is Rietveld 408576698