Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: webrequest.js

Issue 6063199216467968: Issue 2642 - Moved notifications code to separate module (Closed)
Patch Set: Fixed typo in comment Created June 5, 2015, 2:06 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « metadata.common ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrequest.js
===================================================================
--- a/webrequest.js
+++ b/webrequest.js
@@ -18,6 +18,7 @@
var FilterNotifier = require("filterNotifier").FilterNotifier;
var RegExpFilter = require("filterClasses").RegExpFilter;
var platform = require("info").platform;
+var showNextNotification = require("notificationHelper").showNextNotification;
ext.webRequest.indistinguishableTypes.forEach(function(types)
{
@@ -51,11 +52,7 @@
// We can't listen to onHeadersReceived in Safari so we need to
// check for notifications here
if (platform != "chromium" && type == "SUBDOCUMENT")
- {
- var notificationToShow = NotificationStorage.getNextToShow(stringifyURL(url));
- if (notificationToShow)
- showNotification(notificationToShow);
- }
+ showNextNotification(url);
if (filter)
FilterNotifier.triggerListeners("filter.hitCount", filter, 0, 0, page);
@@ -99,9 +96,7 @@
processKey(header.value, page, frame);
}
- var notificationToShow = NotificationStorage.getNextToShow(stringifyURL(new URL(details.url)));
- if (notificationToShow)
- showNotification(notificationToShow);
+ showNextNotification(new URL(details.url));
}
chrome.webRequest.onHeadersReceived.addListener(
« no previous file with comments | « metadata.common ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld