|
|
Created:
9 years, 8 months ago by Finnur Modified:
9 years, 6 months ago CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, pam+watch_chromium.org Base URL:
svn://svn.chromium.org/chrome/trunk/src/ Visibility:
Public. |
DescriptionImplement a simple Extension App Omnibox provider.
BUG=52444
TEST=Install an App from the gallery, then type a substring from its name (or it's launch url) and see it appear as a suggestion in the Omnibox.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=80605
Patch Set 1 #Patch Set 2 : '' #
Total comments: 45
Patch Set 3 : '' #Patch Set 4 : '' #Patch Set 5 : '' #Patch Set 6 : '' #
Total comments: 12
Patch Set 7 : '' #Patch Set 8 : '' #
Total comments: 1
Patch Set 9 : '' #Patch Set 10 : '' #
Messages
Total messages: 21 (0 generated)
This is a first cut at an Omnibox provider for Extension Apps. I'd appreciate any guidance you have for scoring the relevance. I see it to 1200, which is way too high, probably, but useful for testing.
This is a first cut at an Omnibox provider for Extension Apps. I'd appreciate any guidance you have for scoring the relevance. I see it to 1200, which is way too high, probably, but useful for testing.
(Mike, this is an FYI for you) On 2011/03/31 15:58:30, Finnur wrote: > This is a first cut at an Omnibox provider for Extension Apps. I'd appreciate > any guidance you have for scoring the relevance. I see it to 1200, which is way > too high, probably, but useful for testing.
Driveby comments! Oh, wait! When did I become a reviewer? ;^) http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/autocomplete.h (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/autocomplete.h:46: // Extension App (exact match) | 1200 ? Driveby: Should be sorted into the rest of the list properly. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/extension_app_provider.cc (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:21: RegisterForNotifications(); I don't know — I'm just askin': Is it possible for an app notification to come in in between the call to 'RefreshAppList' and the registration for notifications? http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:41: const std::string& name = (*app).first; Nit: "(*app)." ==> "app->", here and the next line. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:57: bool matches_url = url_iter != url.end(); Nit: No need for this 'matches_url' temporary. Just use "url_iter != url.end()" in the 'if' that follows. And 'matches_name' also probably falls into this category. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:63: AutocompleteMatch match(this, 0, false, AutocompleteMatch::HISTORY_URL); Yeah, I'd think we'd want an app type icon at a minimum rather than it showing up as a history match. I'm not sure what I think about having an app-specific icon since it might be better to have the this-is-an-app visual clue versus this-is-TweetDeck. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:147: int ExtensionAppProvider::CalculateRelevance(AutocompleteInput::Type type, Driveby: I'd probably put CalculateRelevance at the end of the file after Observe so that it's not stuck between two functions that have something to do with notifications. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:151: return 1200; Driveby: Yeah, a value based at least on 1) how far from the start of the string the match occurs, and 2) how much of the string matches would probably be a good start. And if it's a URL match which starts at the beginning of the string it is a legitimate candidate for the primary in-the-omnibox candidate. At some point I'm going to figure out how to allow really good matches that don't match from the beginning of the string to be the top in-the-omnibox autocomplete suggestion, but for now we can only do that for URL matches which start at the beginning of the string.
http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/autocomplete.cc (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/autocomplete.cc:800: providers_.push_back(new ExtensionAppProvider(this, profile)); Nit: This ordering is totally random. Can you alphabetize all these while you're here? http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/extension_app_provider.cc (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:24: ExtensionAppProvider::ExtensionAppProvider(ACProviderListener* listener, Will you really be using this? A TemplateURLModel is a very odd thing for a test to give you... http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:35: if (!input.text().empty()) { Your changes to autocomplete.h claimed you only acted on UNKNOWN input types, but this makes no such checks. You should at least reject INVALID input, and you should update the other tables with your scores. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:64: match.fill_into_edit = input.text(); No, you want the string that someone should see when in the omnibox when arrowing down to this choice, which is either the full name or the full URL. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:72: Launch You need to use "Launch $1", not just give a prefix. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:112: done_ = true; Nit: You don't need this. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:115: void ExtensionAppProvider::Stop() { Nit: You don't need to override this. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:123: ExtensionService* extensions_service = profile_->GetExtensionService(); Nit: Roll this into the next statement. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:126: extension_apps_.clear(); Nit: No blank lines above/below this. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:130: if (!(*app)->is_app() || (*app)->launch_web_url().empty()) Nit: Reverse the conditional and do the push_back() conditionally. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:134: (*app)->launch_web_url())); What if this is a relative URL? http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:150: // TODO(finnur): Need to figure out what to return here. You definitely shouldn't return the exact value another provider returns, or your sort will be arbitrary (and possibly unstable). http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/extension_app_provider.h (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.h:68: std::vector<ExtensionApp> extension_apps_; Nit: Make this a typedef also (ExtensionApps).
http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/autocomplete.h (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/autocomplete.h:46: // Extension App (exact match) | 1200 ? Will do, once we figure out the right value... 1200 is a test value. On 2011/03/31 16:44:17, mrossetti wrote: > Driveby: Should be sorted into the rest of the list properly. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/extension_app_provider.cc (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:152: } Thank you both for your comments... It is late, and I'll address both your comments tomorrow, but I want to get the discussion going on this point early... I thought about something similar to what Mike proposed, but these numbers don't mean anything to me (except that higher values lead to higher rankings). Someone said 1200 was way too high as a maximum value but I don't know what is a good lower bound and what is a good upper bound... 1-1000? 500-750? And if it is a sliding scale, won't I have problems if it hits the exact value of some other provider (unstable sort and all), as Peter points out? I also don't know what types I should act on... only UNKNOWN? Combination of some types? Something else?
The values are arbitrary. It depends how you want these to rank among other results. As to what input types you should act on... probably most of them.
But, are there no guidelines for providers? Like, 'everything less than x is usually junk that only appears if nothing else is a good match' or 'don't go above y unless you have a REALLY REALLY good match'? On 2011/03/31 22:40:11, Peter Kasting wrote: > The values are arbitrary. It depends how you want these to rank among other > results. > > As to what input types you should act on... probably most of them.
On 2011/03/31 22:44:53, Finnur wrote: > But, are there no guidelines for providers? Nope. It's a black art :(
Please take another look. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/autocomplete.cc (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/autocomplete.cc:800: providers_.push_back(new ExtensionAppProvider(this, profile)); On 2011/03/31 21:33:59, Peter Kasting wrote: > Nit: This ordering is totally random. Can you alphabetize all these while > you're here? Done. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/extension_app_provider.cc (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:21: RegisterForNotifications(); I don't think so, but I also think that reversing the order is harmless. Done. On 2011/03/31 16:44:17, mrossetti wrote: > I don't know — I'm just askin': Is it possible for an app notification to come > in in between the call to 'RefreshAppList' and the registration for > notifications? http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:24: ExtensionAppProvider::ExtensionAppProvider(ACProviderListener* listener, On 2011/03/31 21:33:59, Peter Kasting wrote: > Will you really be using this? A TemplateURLModel is a very odd thing for a > test to give you... Done. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:35: if (!input.text().empty()) { On 2011/03/31 21:33:59, Peter Kasting wrote: > Your changes to autocomplete.h claimed you only acted on UNKNOWN input types, > but this makes no such checks. You should at least reject INVALID input, and you > should update the other tables with your scores. Done. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:41: const std::string& name = (*app).first; Doh! Done. On 2011/03/31 16:44:17, mrossetti wrote: > Nit: "(*app)." ==> "app->", here and the next line. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:57: bool matches_url = url_iter != url.end(); I think it improves readability. |matches_name| is also used down below. On 2011/03/31 16:44:17, mrossetti wrote: > Nit: No need for this 'matches_url' temporary. Just use "url_iter != url.end()" > in the 'if' that follows. And 'matches_name' also probably falls into this > category. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:63: AutocompleteMatch match(this, 0, false, AutocompleteMatch::HISTORY_URL); Yeah, I'm on the this-is-an-app visual clue side. I think it would be a bit jarring visually to have the extension icon show up, but that's what the mocks called for. For now, the globe looks visually appropriate, so I left it at that until I can get icons from the designers (another changelist). On 2011/03/31 16:44:17, mrossetti wrote: > Yeah, I'd think we'd want an app type icon at a minimum rather than it showing > up as a history match. I'm not sure what I think about having an app-specific > icon since it might be better to have the this-is-an-app visual clue versus > this-is-TweetDeck. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:64: match.fill_into_edit = input.text(); Good point. On 2011/03/31 21:33:59, Peter Kasting wrote: > No, you want the string that someone should see when in the omnibox when > arrowing down to this choice, which is either the full name or the full URL. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:72: Launch I opted to remove this string. It wasn't part of the mocks and it just complicates things in i18n when the parameter might be on the left of the Launch word, conceivably. On 2011/03/31 21:33:59, Peter Kasting wrote: > You need to use "Launch $1", not just give a prefix. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:112: done_ = true; On 2011/03/31 21:33:59, Peter Kasting wrote: > Nit: You don't need this. Done. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:115: void ExtensionAppProvider::Stop() { On 2011/03/31 21:33:59, Peter Kasting wrote: > Nit: You don't need to override this. Done. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:123: ExtensionService* extensions_service = profile_->GetExtensionService(); On 2011/03/31 21:33:59, Peter Kasting wrote: > Nit: Roll this into the next statement. Done. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:126: extension_apps_.clear(); On 2011/03/31 21:33:59, Peter Kasting wrote: > Nit: No blank lines above/below this. Done. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:130: if (!(*app)->is_app() || (*app)->launch_web_url().empty()) On 2011/03/31 21:33:59, Peter Kasting wrote: > Nit: Reverse the conditional and do the push_back() conditionally. Done. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:134: (*app)->launch_web_url())); That is never supposed to happen and we'd have problems in other parts of the code as well (or it would lead to a degraded user experience, I should say). Besides, if it is not a full URL then clicking on the app won't work and we have no way of fixing it up anywhere (not just here), since we don't have the base URL stored. This is basically the only information we have about where to take you when you click the app. If this doesn't work, we have bigger problems. :) On 2011/03/31 21:33:59, Peter Kasting wrote: > What if this is a relative URL? http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:147: int ExtensionAppProvider::CalculateRelevance(AutocompleteInput::Type type, On 2011/03/31 16:44:17, mrossetti wrote: > Driveby: I'd probably put CalculateRelevance at the end of the file after > Observe so that it's not stuck between two functions that have something to do > with notifications. Done. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:151: return 1200; I opted for a simple sliding scale of 850 to 1450 based on how many letters you've typed. I'm hesitant to associate the relevance with the location of the match found, since I'm not sure that partial search at the end of the string is better than a partial match at the beginning of the string. But we can always tweak this later. On 2011/03/31 16:44:17, mrossetti wrote: > Driveby: Yeah, a value based at least on 1) how far from the start of the string > the match occurs, and 2) how much of the string matches would probably be a good > start. And if it's a URL match which starts at the beginning of the string it is > a legitimate candidate for the primary in-the-omnibox candidate. > > At some point I'm going to figure out how to allow really good matches that > don't match from the beginning of the string to be the top in-the-omnibox > autocomplete suggestion, but for now we can only do that for URL matches which > start at the beginning of the string. http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/extension_app_provider.h (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.h:68: std::vector<ExtensionApp> extension_apps_; On 2011/03/31 21:33:59, Peter Kasting wrote: > Nit: Make this a typedef also (ExtensionApps). Done.
LGTM
http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/extension_app_provider.cc (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:134: (*app)->launch_web_url())); On 2011/04/01 15:49:36, Finnur wrote: > That is never supposed to happen and we'd have problems in other parts of the > code as well (or it would lead to a degraded user experience, I should say). Huh. Maybe I misread the comments on its declaration. If that's the case, it seems like it'd be a good idea to make it be a GURL rather than a string (both the code here as well as the |launch_web_url_| itself), don't you think? > > Besides, if it is not a full URL then clicking on the app won't work and we have > no way of fixing it up anywhere (not just here), since we don't have the base > URL stored. This is basically the only information we have about where to take > you when you click the app. If this doesn't work, we have bigger problems. :) > > On 2011/03/31 21:33:59, Peter Kasting wrote: > > What if this is a relative URL? > http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:151: return 1200; On 2011/04/01 15:49:36, Finnur wrote: > I opted for a simple sliding scale of 850 to 1450 based on how many letters > you've typed. Be careful. 1450 is above history exact match/inline autocompletion. That may not be what you want. (For example, if I type "moma" in my address bar, the navigational entry for the intranet site scores 1400, so an app that began with "moma..." could prevent me from navigating there at all). You probably want to score based primarily on typed count, more than length of matched string.
http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/extension_app_provider.cc (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:134: (*app)->launch_web_url())); Um... Sure. I can do that in a followup changelist. On 2011/04/01 16:32:10, Peter Kasting wrote: > On 2011/04/01 15:49:36, Finnur wrote: > > That is never supposed to happen and we'd have problems in other parts of the > > code as well (or it would lead to a degraded user experience, I should say). > > Huh. Maybe I misread the comments on its declaration. If that's the case, it > seems like it'd be a good idea to make it be a GURL rather than a string (both > the code here as well as the |launch_web_url_| itself), don't you think? > > > > > Besides, if it is not a full URL then clicking on the app won't work and we > have > > no way of fixing it up anywhere (not just here), since we don't have the base > > URL stored. This is basically the only information we have about where to take > > you when you click the app. If this doesn't work, we have bigger problems. :) > > > > On 2011/03/31 21:33:59, Peter Kasting wrote: > > > What if this is a relative URL? > > > http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:151: return 1200; My thinking was that the likelyhood of you installing an app with a conflicting name of something you want to navigate to is pretty low. I tried lower values and they worked ok, too. If I lower it to say max 1200, would you accept that as a patch? On 2011/04/01 16:32:10, Peter Kasting wrote: > On 2011/04/01 15:49:36, Finnur wrote: > > I opted for a simple sliding scale of 850 to 1450 based on how many letters > > you've typed. > > Be careful. 1450 is above history exact match/inline autocompletion. That may > not be what you want. (For example, if I type "moma" in my address bar, the > navigational entry for the intranet site scores 1400, so an app that began with > "moma..." could prevent me from navigating there at all). > > You probably want to score based primarily on typed count, more than length of > matched string.
http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... File chrome/browser/autocomplete/extension_app_provider.cc (right): http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... chrome/browser/autocomplete/extension_app_provider.cc:151: return 1200; Yes? No? We are nearing the deadline for M12 features enabled on the branch and we can spend next week tweaking the scoring as necessary... On 2011/04/01 18:10:40, Finnur wrote: > My thinking was that the likelyhood of you installing an app with a conflicting > name of something you want to navigate to is pretty low. I tried lower values > and they worked ok, too. If I lower it to say max 1200, would you accept that as > a patch? > > On 2011/04/01 16:32:10, Peter Kasting wrote: > > On 2011/04/01 15:49:36, Finnur wrote: > > > I opted for a simple sliding scale of 850 to 1450 based on how many letters > > > you've typed. > > > > Be careful. 1450 is above history exact match/inline autocompletion. That > may > > not be what you want. (For example, if I type "moma" in my address bar, the > > navigational entry for the intranet site scores 1400, so an app that began > with > > "moma..." could prevent me from navigating there at all). > > > > You probably want to score based primarily on typed count, more than length of > > matched string. >
On 2011/04/01 20:29:10, Finnur wrote: > http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... > File chrome/browser/autocomplete/extension_app_provider.cc (right): > > http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... > chrome/browser/autocomplete/extension_app_provider.cc:151: return 1200; > Yes? No? We are nearing the deadline for M12 features enabled on the branch and > we can spend next week tweaking the scoring as necessary... Um. An exact match should probably be at 1425. It might be good to rework the HistoryURLProvider to split exact vs. inline autocomplete matches apart and put the extension app exact match between the two, so that extension apps don't hijack URLs (consider an app named "google.com"). For anything else, it depends on whether you intend to inline autocomplete and how good that autocompletion is. If you don't, I'd cap things at 1175. If you do, then at best you probably want to be at 1398, but you probably only want to do that completion if the user has already launched the app via typing this string.
> Um. An exact match should probably be at 1425. OK, kept that. > For anything else, it depends on whether you intend to > inline autocomplete and how good that autocompletion is. > If you don't, I'd cap things at 1175. After talking to Mike, I've decided not to do the inlining for now, so I capped it at 1175. I also reverted the ordering of providers, since just reordering them (without any further changes) causes an interactive test to fail (see try servers for previous patch). Can you take another look? On 2011/04/01 21:02:43, Peter Kasting wrote: > On 2011/04/01 20:29:10, Finnur wrote: > > > http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... > > File chrome/browser/autocomplete/extension_app_provider.cc (right): > > > > > http://codereview.chromium.org/6758031/diff/6002/chrome/browser/autocomplete/... > > chrome/browser/autocomplete/extension_app_provider.cc:151: return 1200; > > Yes? No? We are nearing the deadline for M12 features enabled on the branch > and > > we can spend next week tweaking the scoring as necessary... > > Um. An exact match should probably be at 1425. It might be good to rework the > HistoryURLProvider to split exact vs. inline autocomplete matches apart and put > the extension app exact match between the two, so that extension apps don't > hijack URLs (consider an app named "google.com"). > > For anything else, it depends on whether you intend to inline autocomplete and > how good that autocompletion is. If you don't, I'd cap things at 1175. If you > do, then at best you probably want to be at 1398, but you probably only want to > do that completion if the user has already launched the app via typing this > string.
On 2011/04/01 22:37:19, Finnur wrote: > I also reverted the ordering of providers, since just reordering them (without > any further changes) causes an interactive test to fail (see try servers for > previous patch). That makes no sense to me. The order of providers is not supposed to have any visible effect. It looks to me as if these tests may have failed due to your provider itself (e.g. how its matches were scored)?
As you can see from the try server on the latest patch, the failure stopped occurring. I also did try locally before uploading and if I leave my provider out of the mix -and- I don't reorder, the test succeeds. What do you think about the rest of the patch, though? :) On 2011/04/01 23:38:58, Peter Kasting wrote: > On 2011/04/01 22:37:19, Finnur wrote: > > I also reverted the ordering of providers, since just reordering them (without > > any further changes) causes an interactive test to fail (see try servers for > > previous patch). > > That makes no sense to me. The order of providers is not supposed to have any > visible effect. It looks to me as if these tests may have failed due to your > provider itself (e.g. how its matches were scored)?
I'm mostly concerned about scoring. http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... File chrome/browser/autocomplete/autocomplete.h (right): http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/autocomplete.h:160: // --: relevance score falls off over two days (discounted 99 points after two Nit: While you're here, This line was supposed to be "**" instead of "--". http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... File chrome/browser/autocomplete/autocomplete_browsertest.cc (right): http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/autocomplete_browsertest.cc:120: ASSERT_EQ(2U, result.size()) << AutocompleteResultAsString(result); Nit: Maybe ASSERT_GE(result.size(), 1U)? http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... File chrome/browser/autocomplete/extension_app_provider.cc (right): http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/extension_app_provider.cc:29: input.type() == AutocompleteInput::FORCED_QUERY) You should probably handle FORCED_QUERY but maybe only match against the app title in that case? http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/extension_app_provider.cc:64: size_t pos = name_iter - name.begin(); Nit: This block of code is basically repeated verbatim below. Maybe factor to a helper function. http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/extension_app_provider.cc:133: switch (type.value) { Nit: I don't think all this is useful. Just make the body be the single line "RefreshAppList()". Nobody's going to add more notifications without updating this function anyway. http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/extension_app_provider.cc:152: // Sliding scale from 700+100 to 1175 based on how many characters you typed. I suggest scaling from 400 up instead of 800, and making the scale be based on the fraction of the full length typed rather than just the number of raw characters. Even better would be to incorporate (as the primary factor) how many times the extension's launch URL has been typed. You could use the in-memory URL database to ask that.
Scoring algorithm changed. Please take another look. http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... File chrome/browser/autocomplete/autocomplete.h (right): http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/autocomplete.h:160: // --: relevance score falls off over two days (discounted 99 points after two On 2011/04/04 19:35:32, Peter Kasting wrote: > Nit: While you're here, This line was supposed to be "**" instead of "--". Done. http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... File chrome/browser/autocomplete/autocomplete_browsertest.cc (right): http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/autocomplete_browsertest.cc:120: ASSERT_EQ(2U, result.size()) << AutocompleteResultAsString(result); On 2011/04/04 19:35:32, Peter Kasting wrote: > Nit: Maybe ASSERT_GE(result.size(), 1U)? Done. http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... File chrome/browser/autocomplete/extension_app_provider.cc (right): http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/extension_app_provider.cc:29: input.type() == AutocompleteInput::FORCED_QUERY) Sound good. Done. On 2011/04/04 19:35:32, Peter Kasting wrote: > You should probably handle FORCED_QUERY but maybe only match against the app > title in that case? http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/extension_app_provider.cc:64: size_t pos = name_iter - name.begin(); Good idea. Done. On 2011/04/04 19:35:32, Peter Kasting wrote: > Nit: This block of code is basically repeated verbatim below. Maybe factor to a > helper function. http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/extension_app_provider.cc:133: switch (type.value) { On 2011/04/04 19:35:32, Peter Kasting wrote: > Nit: I don't think all this is useful. Just make the body be the single line > "RefreshAppList()". Nobody's going to add more notifications without updating > this function anyway. Done. http://codereview.chromium.org/6758031/diff/15001/chrome/browser/autocomplete... chrome/browser/autocomplete/extension_app_provider.cc:152: // Sliding scale from 700+100 to 1175 based on how many characters you typed. See? I knew there was a guideline hidden in there somewhere if probed correctly. :) I have changed it so that we give a baseline of 400 points + up to 400* + up to 200**. * based on how many times the user has typed in the URL. ** based on how much of the input matches. Based on my testing I still feel these are too low, based on what I see in the Omnibox results, but I'm willing see what people think once they try it out. On 2011/04/04 19:35:32, Peter Kasting wrote: > I suggest scaling from 400 up instead of 800, and making the scale be based on > the fraction of the full length typed rather than just the number of raw > characters. > > Even better would be to incorporate (as the primary factor) how many times the > extension's launch URL has been typed. You could use the in-memory URL database > to ask that.
LGTM when you feel the scores are good. http://codereview.chromium.org/6758031/diff/15003/chrome/browser/autocomplete... File chrome/browser/autocomplete/extension_app_provider.cc (right): http://codereview.chromium.org/6758031/diff/15003/chrome/browser/autocomplete... chrome/browser/autocomplete/extension_app_provider.cc:142: // reach 200 because the 100% match is taken care of above). This scoring algorithm looks better! I suggest the following tweaks to help deal with your observation (which I believe) that the scores are too low. * Boost the base score from 400 to 575. This will make you once again peak at 1175 (which is still what the tables in autocomplete.h, though not the legend below, say). * Scale the typed count bonus faster by using the following formula for |typed_count_boost|: typed_count_boost = 400 * (1.0 - (2 ^ -info.typed.count())); Ultimately, you probably do want to do inline autocompletion for previously-typed apps, which will mean scaling all the way up to at least 1425, but for now maybe these tweaks will help some. |