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

Unified Diff: content/public/common/page_zoom.h

Issue 224733018: Changes to content/ to facilitate new zoom extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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: content/public/common/page_zoom.h
diff --git a/content/public/common/page_zoom.h b/content/public/common/page_zoom.h
index aa5e56a90711b089987afdbcf17eafd49ddf67e2..f831bf530a6a034128dbb90a4c5dce0689664826 100644
--- a/content/public/common/page_zoom.h
+++ b/content/public/common/page_zoom.h
@@ -5,6 +5,10 @@
#ifndef CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_
#define CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_
+#include <string>
+
+#include "base/logging.h"
+#include "base/values.h"
#include "content/common/content_export.h"
namespace content {
@@ -39,6 +43,34 @@ CONTENT_EXPORT bool ZoomValuesEqual(double value_a, double value_b);
CONTENT_EXPORT double ZoomLevelToZoomFactor(double zoom_level);
CONTENT_EXPORT double ZoomFactorToZoomLevel(double factor);
+// Defines how zoom changes are handled.
+// |kZoomModeDefault| results in default zoom behavior, i.e. zoom changes are
+// handled automatically and on a per-origin basis, meaning that other
+// tabs navigated to the same origin will also zoom.
+// |kZoomModeIsolated| results in zoom changes being handled automatically,
+// but on a per-tab basis. Tabs in this zoom mode will not be affected by
+// zoom changes in other tabs, and vice versa.
+// |kZoomModeManual| overrides the automatic handling of zoom changes. The
+// |onZoomChange| event will still be dispatched, but the page will not
+// actually be zoomed. These zoom changes can be handled manually by
+// listening for the |onZoomChange| event. Zooming in this mode is also on
+// a per-tab basis.
+// |kZoomModeDisabled| disables all zooming in this tab. The tab will revert
+// to default (100%) zoom, and all attempted zoom changes will be ignored.
+enum ZoomMode {
+ kZoomModeDefault,
+ kZoomModeIsolated,
+ kZoomModeManual,
+ kZoomModeDisabled,
+};
+
+// Details for the |onZoomChange| event.
+struct ZoomChangeDetails {
+ double old_zoom_level;
+ double new_zoom_level;
+ content::ZoomMode zoom_mode;
+};
+
} // namespace content
#endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_

Powered by Google App Engine
This is Rietveld 408576698