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

Unified Diff: chrome/browser/intents/web_intents_registry.cc

Issue 10914278: Fix for non-sticky defaults bug. Added a bunch of tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to head 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/browser/intents/web_intents_registry_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/intents/web_intents_registry.cc
diff --git a/chrome/browser/intents/web_intents_registry.cc b/chrome/browser/intents/web_intents_registry.cc
index 62d0789ad404cab524d70358bdabbc5322e9423d..5b332a2d4efa4a2b15ee22981516e73eff4283e2 100644
--- a/chrome/browser/intents/web_intents_registry.cc
+++ b/chrome/browser/intents/web_intents_registry.cc
@@ -289,6 +289,7 @@ void WebIntentsRegistry::OnWebIntentsDefaultsResultReceived(
// Found a match. If it is better than default_service, use it.
// Currently the metric is that if the new value is user-set,
// prefer it. If the new value has a more specific pattern, prefer it.
+ // If the new value has a more recent date, prefer it.
if (default_service.user_date <= 0 && iter->user_date >= 0) {
default_service = *iter;
} else if (default_service.url_pattern.match_all_urls() &&
@@ -296,6 +297,8 @@ void WebIntentsRegistry::OnWebIntentsDefaultsResultReceived(
default_service = *iter;
} else if (iter->url_pattern < default_service.url_pattern) {
default_service = *iter;
+ } else if (default_service.user_date < iter->user_date) {
+ default_service = *iter;
}
}
« no previous file with comments | « no previous file | chrome/browser/intents/web_intents_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698