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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_api.h

Issue 225093019: Zoom Extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 8 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/api/tabs/tabs_api.h
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.h b/chrome/browser/extensions/api/tabs/tabs_api.h
index 481046977f7ca7d439fa670f0141d263be41cf11..7c8989cbe01600cd0b3fcd44342c0b7ee16dcb1e 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.h
+++ b/chrome/browser/extensions/api/tabs/tabs_api.h
@@ -42,6 +42,10 @@ class PrefRegistrySyncable;
namespace extensions {
+// Converts a ZoomMode to its ZoomSettings representation.
+void ZoomModeToZoomSettings(content::ZoomMode zoom_mode,
+ api::tabs::ZoomSettings* zoom_settings);
+
// Windows
class WindowsGetFunction : public ChromeSyncExtensionFunction {
virtual ~WindowsGetFunction() {}
@@ -256,6 +260,54 @@ class TabsInsertCSSFunction : public ExecuteCodeInTabFunction {
DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS)
};
+class ZoomAPIFunction : public ChromeAsyncExtensionFunction {
+ protected:
+ virtual ~ZoomAPIFunction() {}
+
+ // Gets the WebContents for |tab_id| if it is specified. Otherwise get the
+ // WebContents for the active tab in the current window.
+ //
+ // TODO(...) many other tabs API functions use similar behavior. There should
+ // be a way to share this implementation somehow.
+ bool GetWebContents(int* tab_id, content::WebContents** web_contents);
+};
+
+class TabsSetZoomFunction : public ZoomAPIFunction {
+ private:
+ virtual ~TabsSetZoomFunction() {}
+
+ virtual bool RunImpl() OVERRIDE;
+
+ DECLARE_EXTENSION_FUNCTION("tabs.setZoom", TABS_SETZOOM)
+};
+
+class TabsGetZoomFunction : public ZoomAPIFunction {
+ private:
+ virtual ~TabsGetZoomFunction() {}
+
+ virtual bool RunImpl() OVERRIDE;
+
+ DECLARE_EXTENSION_FUNCTION("tabs.getZoom", TABS_GETZOOM)
+};
+
+class TabsSetZoomSettingsFunction : public ZoomAPIFunction {
+ private:
+ virtual ~TabsSetZoomSettingsFunction() {}
+
+ virtual bool RunImpl() OVERRIDE;
+
+ DECLARE_EXTENSION_FUNCTION("tabs.setZoomSettings", TABS_SETZOOMSETTINGS)
+};
+
+class TabsGetZoomSettingsFunction : public ZoomAPIFunction {
+ private:
+ virtual ~TabsGetZoomSettingsFunction() {}
+
+ virtual bool RunImpl() OVERRIDE;
+
+ DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS)
+};
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_

Powered by Google App Engine
This is Rietveld 408576698