| Index: chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h
|
| diff --git a/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h b/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h
|
| index 32dec51ac781038f6f103ac9068317c4c755194b..612b7b4d7980e44ff775d277079dbdce84107034 100644
|
| --- a/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h
|
| +++ b/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h
|
| @@ -36,44 +36,68 @@ class WebContents;
|
| // Creates an offscreen tab.
|
| class CreateOffscreenTabFunction : public SyncExtensionFunction {
|
| public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.create")
|
| +
|
| CreateOffscreenTabFunction();
|
| - private:
|
| +
|
| + protected:
|
| virtual ~CreateOffscreenTabFunction();
|
| +
|
| + // ExtensionFunction:
|
| virtual bool RunImpl() OVERRIDE;
|
| - DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.create")
|
| +
|
| + private:
|
| DISALLOW_COPY_AND_ASSIGN(CreateOffscreenTabFunction);
|
| };
|
|
|
| // Gets info about an offscreen tab.
|
| class GetOffscreenTabFunction : public SyncExtensionFunction {
|
| public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.get")
|
| +
|
| GetOffscreenTabFunction();
|
| - private:
|
| +
|
| + protected:
|
| virtual ~GetOffscreenTabFunction();
|
| +
|
| + // ExtensionFunction:
|
| virtual bool RunImpl() OVERRIDE;
|
| - DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.get")
|
| +
|
| + private:
|
| DISALLOW_COPY_AND_ASSIGN(GetOffscreenTabFunction);
|
| };
|
|
|
| // Gets all offscreen tabs created by the tab that invoked this function.
|
| class GetAllOffscreenTabFunction : public SyncExtensionFunction {
|
| public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.getAll")
|
| +
|
| GetAllOffscreenTabFunction();
|
| - private:
|
| +
|
| + protected:
|
| virtual ~GetAllOffscreenTabFunction();
|
| +
|
| + // ExtensionFunction:
|
| virtual bool RunImpl() OVERRIDE;
|
| - DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.getAll")
|
| +
|
| + private:
|
| DISALLOW_COPY_AND_ASSIGN(GetAllOffscreenTabFunction);
|
| };
|
|
|
| // Removes an offscreen tab.
|
| class RemoveOffscreenTabFunction : public SyncExtensionFunction {
|
| public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.remove")
|
| +
|
| RemoveOffscreenTabFunction();
|
| - private:
|
| +
|
| + protected:
|
| virtual ~RemoveOffscreenTabFunction();
|
| +
|
| + // ExtensionFunction:
|
| virtual bool RunImpl() OVERRIDE;
|
| - DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.remove")
|
| +
|
| + private:
|
| DISALLOW_COPY_AND_ASSIGN(RemoveOffscreenTabFunction);
|
| };
|
|
|
| @@ -81,12 +105,18 @@ class RemoveOffscreenTabFunction : public SyncExtensionFunction {
|
| // TODO(jstritar): This would be useful on the chrome.tabs API.
|
| class SendKeyboardEventOffscreenTabFunction : public SyncExtensionFunction {
|
| public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME(
|
| + "experimental.offscreenTabs.sendKeyboardEvent")
|
| +
|
| SendKeyboardEventOffscreenTabFunction();
|
| - private:
|
| +
|
| + protected:
|
| virtual ~SendKeyboardEventOffscreenTabFunction();
|
| +
|
| + // ExtensionFunction:
|
| virtual bool RunImpl() OVERRIDE;
|
| - DECLARE_EXTENSION_FUNCTION_NAME(
|
| - "experimental.offscreenTabs.sendKeyboardEvent")
|
| +
|
| + private:
|
| DISALLOW_COPY_AND_ASSIGN(SendKeyboardEventOffscreenTabFunction);
|
| };
|
|
|
| @@ -96,36 +126,56 @@ class SendKeyboardEventOffscreenTabFunction : public SyncExtensionFunction {
|
| // TODO(jstritar): This would be useful on the chrome.tabs API.
|
| class SendMouseEventOffscreenTabFunction : public SyncExtensionFunction {
|
| public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.sendMouseEvent")
|
| +
|
| SendMouseEventOffscreenTabFunction();
|
| - private:
|
| +
|
| + protected:
|
| virtual ~SendMouseEventOffscreenTabFunction();
|
| +
|
| + // ExtensionFunction:
|
| virtual bool RunImpl() OVERRIDE;
|
| - DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.sendMouseEvent")
|
| +
|
| + private:
|
| DISALLOW_COPY_AND_ASSIGN(SendMouseEventOffscreenTabFunction);
|
| };
|
|
|
| // Gets a snapshot of the offscreen tab and returns it as a data URL.
|
| class ToDataUrlOffscreenTabFunction : public CaptureVisibleTabFunction {
|
| public:
|
| + // TODO(jstritar): Rename to toDataUrl.
|
| + DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.toDataUrl")
|
| +
|
| ToDataUrlOffscreenTabFunction();
|
| - private:
|
| +
|
| + protected:
|
| virtual ~ToDataUrlOffscreenTabFunction();
|
| +
|
| + // CaptureVisibleTabFunction:
|
| virtual bool GetTabToCapture(content::WebContents** web_contents,
|
| TabContentsWrapper** wrapper) OVERRIDE;
|
| - // TODO(jstritar): Rename to toDataUrl.
|
| - DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.toDataUrl")
|
| +
|
| + private:
|
| DISALLOW_COPY_AND_ASSIGN(ToDataUrlOffscreenTabFunction);
|
| };
|
|
|
| // Updates an offscreen tab.
|
| class UpdateOffscreenTabFunction : public UpdateTabFunction {
|
| public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.update")
|
| +
|
| UpdateOffscreenTabFunction();
|
| - private:
|
| +
|
| + protected:
|
| virtual ~UpdateOffscreenTabFunction();
|
| +
|
| + // ExtensionFunction:
|
| virtual bool RunImpl() OVERRIDE;
|
| +
|
| + // UpdateTabFunction:
|
| virtual void PopulateResult() OVERRIDE;
|
| - DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.update")
|
| +
|
| + private:
|
| DISALLOW_COPY_AND_ASSIGN(UpdateOffscreenTabFunction);
|
| };
|
|
|
|
|