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

Side by Side Diff: content/browser/resources/service_worker/serviceworker_internals.js

Issue 296463005: Push API: fire push event from chrome://serviceworker-internals/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 6 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
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 cr.define('serviceworker', function() { 5 cr.define('serviceworker', function() {
6 'use strict'; 6 'use strict';
7 7
8 function initialize() { 8 function initialize() {
9 if (window.location.hash == "#iframe") { 9 if (window.location.hash == "#iframe") {
10 // This page is loaded from chrome://inspect. 10 // This page is loaded from chrome://inspect.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 inputs[i].hasClickEvent = true; 46 inputs[i].hasClickEvent = true;
47 } 47 }
48 } 48 }
49 } 49 }
50 50
51 function progressNodeFor(link) { 51 function progressNodeFor(link) {
52 return link.parentNode.querySelector('.operation-status'); 52 return link.parentNode.querySelector('.operation-status');
53 } 53 }
54 54
55 // All commands are completed with 'onOperationComplete'. 55 // All commands are completed with 'onOperationComplete'.
56 var COMMANDS = ['stop', 'sync', 'inspect', 'unregister', 'start']; 56 var COMMANDS = ['stop', 'sync', 'push', 'inspect', 'unregister', 'start'];
57 function commandHandler(command) { 57 function commandHandler(command) {
58 return function(event) { 58 return function(event) {
59 var link = event.target; 59 var link = event.target;
60 progressNodeFor(link).style.display = 'inline'; 60 progressNodeFor(link).style.display = 'inline';
61 sendCommand(command, link.cmdArgs, (function(status) { 61 sendCommand(command, link.cmdArgs, (function(status) {
62 progressNodeFor(link).style.display = 'none'; 62 progressNodeFor(link).style.display = 'none';
63 }).bind(null, link)); 63 }).bind(null, link));
64 return false; 64 return false;
65 }; 65 };
66 }; 66 };
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 onWorkerStopped: onWorkerStopped, 295 onWorkerStopped: onWorkerStopped,
296 onErrorReported: onErrorReported, 296 onErrorReported: onErrorReported,
297 onConsoleMessageReported: onConsoleMessageReported, 297 onConsoleMessageReported: onConsoleMessageReported,
298 onVersionStateChanged: onVersionStateChanged, 298 onVersionStateChanged: onVersionStateChanged,
299 onRegistrationStored: onRegistrationStored, 299 onRegistrationStored: onRegistrationStored,
300 onRegistrationDeleted: onRegistrationDeleted, 300 onRegistrationDeleted: onRegistrationDeleted,
301 }; 301 };
302 }); 302 });
303 303
304 document.addEventListener('DOMContentLoaded', serviceworker.initialize); 304 document.addEventListener('DOMContentLoaded', serviceworker.initialize);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698