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

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: Add braces around if-clause statement. 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
« no previous file with comments | « chrome/common/extensions/docs/examples/api/tabs/zoom/popup.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d96bc74eff11af9bdf735262d510db85f725a784 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, 0, function() {
if (chrome.runtime.lastError)
console.log('[ZoomDemoExtension] ' + chrome.runtime.lastError.message);
});
« no previous file with comments | « chrome/common/extensions/docs/examples/api/tabs/zoom/popup.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698