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

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

Issue 1093603002: Change JS parameter to camel case. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 5 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 unified diff | Download patch
« no previous file with comments | « chrome/common/extensions/api/tabs.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview This code supports the popup behaviour of the extension, and 6 * @fileoverview This code supports the popup behaviour of the extension, and
7 * demonstrates how to: 7 * demonstrates how to:
8 * 8 *
9 * 1) Set the zoom for a tab using tabs.setZoom() 9 * 1) Set the zoom for a tab using tabs.setZoom()
10 * 2) Read the current zoom of a tab using tabs.getZoom() 10 * 2) Read the current zoom of a tab using tabs.getZoom()
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 modeRadios[i].checked = true; 44 modeRadios[i].checked = true;
45 } 45 }
46 46
47 var scopeRadios = document.getElementsByName('scopeRadio'); 47 var scopeRadios = document.getElementsByName('scopeRadio');
48 for (var i = 0; i < scopeRadios.length; i++) { 48 for (var i = 0; i < scopeRadios.length; i++) {
49 if (scopeRadios[i].value == zoomSettings.scope) 49 if (scopeRadios[i].value == zoomSettings.scope)
50 scopeRadios[i].checked = true; 50 scopeRadios[i].checked = true;
51 } 51 }
52 52
53 var percentDefaultZoom = 53 var percentDefaultZoom =
54 parseFloat(zoomSettings.default_zoom_factor) * 100; 54 parseFloat(zoomSettings.defaultZoomFactor) * 100;
55 document.getElementById('defaultLabel').textContent = 55 document.getElementById('defaultLabel').textContent =
56 'Default: ' + percentDefaultZoom.toFixed(1) + '%'; 56 'Default: ' + percentDefaultZoom.toFixed(1) + '%';
57 }); 57 });
58 58
59 chrome.tabs.getZoom(tabId, displayZoomLevel); 59 chrome.tabs.getZoom(tabId, displayZoomLevel);
60 }); 60 });
61 61
62 document.getElementById('increaseButton').onclick = doZoomIn; 62 document.getElementById('increaseButton').onclick = doZoomIn;
63 document.getElementById('decreaseButton').onclick = doZoomOut; 63 document.getElementById('decreaseButton').onclick = doZoomOut;
64 document.getElementById('defaultButton').onclick = doZoomDefault; 64 document.getElementById('defaultButton').onclick = doZoomDefault;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 if (chrome.runtime.lastError) { 132 if (chrome.runtime.lastError) {
133 console.log('[ZoomDemoExtension] doSetMode() error: ' + 133 console.log('[ZoomDemoExtension] doSetMode() error: ' +
134 chrome.runtime.lastError.message); 134 chrome.runtime.lastError.message);
135 } 135 }
136 }); 136 });
137 } 137 }
138 138
139 function doClose() { 139 function doClose() {
140 self.close(); 140 self.close();
141 } 141 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/tabs.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698