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

Unified Diff: chrome/common/extensions/docs/examples/api/messaging/timer/popup.js

Issue 9289057: Changing manifest to v2 extension samples (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding zip files after rebasing with master Created 8 years, 11 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/messaging/timer/popup.js
diff --git a/chrome/common/extensions/docs/examples/api/messaging/timer/popup.html b/chrome/common/extensions/docs/examples/api/messaging/timer/popup.js
similarity index 76%
copy from chrome/common/extensions/docs/examples/api/messaging/timer/popup.html
copy to chrome/common/extensions/docs/examples/api/messaging/timer/popup.js
index e20e799a5e98a08bc498005bc59f8d31458f6cc1..c213baf18b0827d4a3a03f2157df1476627d2af1 100644
--- a/chrome/common/extensions/docs/examples/api/messaging/timer/popup.html
+++ b/chrome/common/extensions/docs/examples/api/messaging/timer/popup.js
@@ -1,15 +1,7 @@
-<head>
-<style>
-tr {
- white-space: nowrap;
-}
-.results {
- text-align: right;
- min-width: 6em;
- color: black;
-}
-</style>
-<script>
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
if (!chrome.benchmarking) {
alert("Warning: Looks like you forgot to run chrome with " +
" --enable-benchmarking set.");
@@ -61,17 +53,10 @@ function testConnect() {
});
});
}
-</script>
-</head>
-<body>
-<table>
- <tr>
- <td><button onclick="testRequest()">Measure sendRequest</button></td>
- <td id="resultsRequest" class="results">(results)</td>
- </tr>
- <tr>
- <td><button onclick="testConnect()">Measure postMessage</button></td>
- <td id="resultsConnect" class="results">(results)</td>
- </tr>
-</table>
-</body>
+
+document.addEventListener('DOMContentLoaded', function() {
+ document.querySelector('#testRequest').addEventListener(
+ 'click', testRequest);
+ document.querySelector('#testConnect').addEventListener(
+ 'click', testConnect);
+});

Powered by Google App Engine
This is Rietveld 408576698