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

Unified Diff: chrome/common/extensions/docs/examples/extensions/gmail/background.js

Issue 10984030: Fix Gmail Checker to update on reference fragment navigations, so the unread (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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 | « no previous file | chrome/common/extensions/docs/examples/extensions/gmail/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/examples/extensions/gmail/background.js
diff --git a/chrome/common/extensions/docs/examples/extensions/gmail/background.js b/chrome/common/extensions/docs/examples/extensions/gmail/background.js
index 8f26bfed9faab3bc64530d430f7eb307f087408e..b77d70610f7610ed1dfbfc936e648371aa04087a 100644
--- a/chrome/common/extensions/docs/examples/extensions/gmail/background.js
+++ b/chrome/common/extensions/docs/examples/extensions/gmail/background.js
@@ -324,13 +324,16 @@ var filters = {
url: [{urlContains: getGmailUrl().replace(/^https?\:\/\//, '')}]
};
-chrome.webNavigation.onDOMContentLoaded.addListener(function(changeInfo) {
- if (changeInfo.url && isGmailUrl(changeInfo.url)) {
- console.log('Recognized Gmail navigation to: ' + changeInfo.url + '.' +
+function onNavigate(details) {
+ if (details.url && isGmailUrl(details.url)) {
+ console.log('Recognized Gmail navigation to: ' + details.url + '.' +
'Refreshing count...');
startRequest({scheduleRequest:false, showLoadingAnimation:false});
}
-}, filters);
+}
+chrome.webNavigation.onDOMContentLoaded.addListener(onNavigate, filters);
+chrome.webNavigation.onReferenceFragmentUpdated.addListener(
Aaron Boodman 2012/09/25 21:38:14 This doesn't exist on Chrome 21, so it's going to
Matt Perry 2012/09/25 21:57:40 It exists, even on stable: http://developer.chrome
Matt Perry 2012/09/25 22:09:08 I added a feature detect anyway, just to be parano
+ onNavigate, filters);
chrome.browserAction.onClicked.addListener(goToInbox);
« no previous file with comments | « no previous file | chrome/common/extensions/docs/examples/extensions/gmail/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698