summaryrefslogtreecommitdiffstats
path: root/chrome/browser/intents
diff options
context:
space:
mode:
authorgbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-10 19:40:23 +0000
committergbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-10 19:40:23 +0000
commit914ab21b8cd275ca5dbe3c87fc8c53c0b9f0cb93 (patch)
treee444fa67d6c4b719b7e7393b91bfb2c0558976ba /chrome/browser/intents
parent1cbd30f2ddf933599aac69eca320d7f3cd650805 (diff)
downloadchromium_src-914ab21b8cd275ca5dbe3c87fc8c53c0b9f0cb93.zip
chromium_src-914ab21b8cd275ca5dbe3c87fc8c53c0b9f0cb93.tar.gz
chromium_src-914ab21b8cd275ca5dbe3c87fc8c53c0b9f0cb93.tar.bz2
Store user's selection as a default.
R=groby@chromium.org TBR=jhawkins@chromium.org BUG=110636 TEST=WebIntentPickerControllerBrowserTest.* Review URL: https://chromiumcodereview.appspot.com/10796039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/intents')
-rw-r--r--chrome/browser/intents/default_web_intent_service.h7
-rw-r--r--chrome/browser/intents/web_intents_registry.cc5
2 files changed, 5 insertions, 7 deletions
diff --git a/chrome/browser/intents/default_web_intent_service.h b/chrome/browser/intents/default_web_intent_service.h
index beb9ba7..f0a93be 100644
--- a/chrome/browser/intents/default_web_intent_service.h
+++ b/chrome/browser/intents/default_web_intent_service.h
@@ -39,9 +39,10 @@ struct DefaultWebIntentService {
// If the user did not set the default explicitly, is <= 0.
int user_date;
- // |suppression| holds a value modeling whether a default is suppressed.
- // If it has value == 0, the default is active.
- int suppression;
+ // |suppression| holds a value indicating what the suppression context
+ // for the default should be. Currently it holds a hash value of the other
+ // current entries in the picker model when the default was set.
+ int64 suppression;
std::string service_url;
diff --git a/chrome/browser/intents/web_intents_registry.cc b/chrome/browser/intents/web_intents_registry.cc
index eea38a6..720c158 100644
--- a/chrome/browser/intents/web_intents_registry.cc
+++ b/chrome/browser/intents/web_intents_registry.cc
@@ -310,12 +310,9 @@ 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 present value is suppressed, prefer it.
- // If the new value has a more specific pattern, prefer it.
+ // prefer it. If the new value has a more specific pattern, prefer it.
if (default_service.user_date <= 0 && iter->user_date >= 0)
default_service = *iter;
- else if (default_service.suppression > 0 && iter->suppression <= 0)
- default_service = *iter;
else if (default_service.url_pattern.match_all_urls() &&
!iter->url_pattern.match_all_urls())
default_service = *iter;