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

Unified Diff: chrome/common/extensions/docs/examples/api/tabs/zoom/popup.js

Issue 1051013002: Add default zoom functionality to chrome.tabs Zoom API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/common/extensions/docs/examples/api/tabs/zoom/popup.js
diff --git a/chrome/common/extensions/docs/examples/api/tabs/zoom/popup.js b/chrome/common/extensions/docs/examples/api/tabs/zoom/popup.js
index 1b0fcd8db3ed14f33cf68efec26d8a6c1f250709..ef4d668ca539a68849a8083c8c4a6cc82e259312 100644
--- a/chrome/common/extensions/docs/examples/api/tabs/zoom/popup.js
+++ b/chrome/common/extensions/docs/examples/api/tabs/zoom/popup.js
@@ -49,6 +49,11 @@ document.addEventListener('DOMContentLoaded', function() {
if (scopeRadios[i].value == zoomSettings.scope)
scopeRadios[i].checked = true;
}
+
+ var percentDefaultZoom =
+ parseFloat(zoomSettings.default_zoom_factor) * 100;
+ document.getElementById('defaultLabel').textContent =
+ 'Default: ' + percentDefaultZoom.toFixed(1) + '%';
});
chrome.tabs.getZoom(tabId, displayZoomLevel);
@@ -92,7 +97,7 @@ function doZoomDefault() {
if (tabId == -1)
return;
- chrome.tabs.setZoom(tabId, 1.0, function() {
+ chrome.tabs.setZoom(tabId, 'default', function() {
not at google - send to devlin 2015/04/01 20:34:07 Need to update this.
wjmaclean 2015/04/01 21:23:24 Ooops, missed that one, thanks! Done.
if (chrome.runtime.lastError)
console.log('[ZoomDemoExtension] ' + chrome.runtime.lastError.message);
});

Powered by Google App Engine
This is Rietveld 408576698