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

Side by Side Diff: chrome/browser/extensions/extension_offscreen_tabs_module.h

Issue 9150052: Re-land alexbost's experimental Offscreen Tabs API work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor test cleanups. Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_H__
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_H__
7 #pragma once
8
9 #include <string>
10
11 #include "base/values.h"
12 #include "chrome/browser/extensions/extension_function.h"
13 #include "chrome/browser/extensions/extension_tabs_module.h"
14 #include "content/public/browser/notification_observer.h"
15 #include "content/public/browser/notification_registrar.h"
16 #include "content/public/browser/web_contents_observer.h"
17
18 // For the moment we make the offscreen tabs module depend on the tabs
19 // module so we can share some code between them. The long-term goal
20 // is to fold the offscreen tabs functionality into the tabs API
21 // anyway.
22
23 class BackingStore;
24 class SkBitmap;
25
26 // Creates an offscreen tab and adds it to a map of tabs and their child
27 // offscreen tabs.
28 class CreateOffscreenTabFunction : public SyncExtensionFunction {
29 public:
30 CreateOffscreenTabFunction();
31 private:
32 virtual ~CreateOffscreenTabFunction();
33 virtual bool RunImpl() OVERRIDE;
34 DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.create")
35 DISALLOW_COPY_AND_ASSIGN(CreateOffscreenTabFunction);
36 };
37
38 // Gets info about an offscreen tab.
39 class GetOffscreenTabFunction : public SyncExtensionFunction {
40 public:
41 GetOffscreenTabFunction();
42 private:
43 virtual ~GetOffscreenTabFunction();
44 virtual bool RunImpl() OVERRIDE;
45 DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.get")
46 DISALLOW_COPY_AND_ASSIGN(GetOffscreenTabFunction);
47 };
48
49 // Gets all offscreen tabs created by the tab that invoked this function.
50 class GetAllOffscreenTabFunction : public SyncExtensionFunction {
51 public:
52 GetAllOffscreenTabFunction();
53 private:
54 virtual ~GetAllOffscreenTabFunction();
55 virtual bool RunImpl() OVERRIDE;
56 DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.getAll")
57 DISALLOW_COPY_AND_ASSIGN(GetAllOffscreenTabFunction);
58 };
59
60 // Removes an offscreen tab.
61 class RemoveOffscreenTabFunction : public SyncExtensionFunction {
62 public:
63 RemoveOffscreenTabFunction();
64 private:
65 virtual ~RemoveOffscreenTabFunction();
66 virtual bool RunImpl() OVERRIDE;
67 DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.remove")
68 DISALLOW_COPY_AND_ASSIGN(RemoveOffscreenTabFunction);
69 };
70
71 // Synthesizes a keyboard event based on a passed-in JavaScript keyboard event.
72 class SendKeyboardEventOffscreenTabFunction : public SyncExtensionFunction {
73 public:
74 SendKeyboardEventOffscreenTabFunction();
75 private:
76 virtual ~SendKeyboardEventOffscreenTabFunction();
77 virtual bool RunImpl() OVERRIDE;
78 DECLARE_EXTENSION_FUNCTION_NAME(
79 "experimental.offscreenTabs.sendKeyboardEvent")
80 DISALLOW_COPY_AND_ASSIGN(SendKeyboardEventOffscreenTabFunction);
81 };
82
83 // Synthesizes a mouse event based on a passed-in JavaScript mouse event.
84 // Since only the application knows where the user clicks, x and y coordinates
85 // need to be passed in as well in this case of click, mousedown, and mouseup.
86 class SendMouseEventOffscreenTabFunction : public SyncExtensionFunction {
87 public:
88 SendMouseEventOffscreenTabFunction();
89 private:
90 virtual ~SendMouseEventOffscreenTabFunction();
91 virtual bool RunImpl() OVERRIDE;
92 DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.sendMouseEvent")
93 DISALLOW_COPY_AND_ASSIGN(SendMouseEventOffscreenTabFunction);
94 };
95
96 // Gets a snapshot of the offscreen tab and returns it as a data URL.
97 class ToDataUrlOffscreenTabFunction : public CaptureVisibleTabFunction {
98 public:
99 ToDataUrlOffscreenTabFunction();
100 private:
101 virtual ~ToDataUrlOffscreenTabFunction();
102 virtual bool RunImpl() OVERRIDE;
103
104 DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.toDataUrl")
105 DISALLOW_COPY_AND_ASSIGN(ToDataUrlOffscreenTabFunction);
106 };
107
108 // Updates an offscreen tab.
109 class UpdateOffscreenTabFunction : public UpdateTabFunction {
110 public:
111 UpdateOffscreenTabFunction();
112
113 private:
114 virtual ~UpdateOffscreenTabFunction();
115 virtual bool RunImpl() OVERRIDE;
116
117 DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.update")
118 DISALLOW_COPY_AND_ASSIGN(UpdateOffscreenTabFunction);
119 };
120
121 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_H__
122
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698