Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Issue 10908226: Introduces a search term extraction mechanism working for arbitrary search providers. (Closed)

Created:
8 years, 3 months ago by beaudoin
Modified:
8 years, 2 months ago
CC:
chromium-reviews, dominich, gideonwald, sreeram, pink (ping after 24hrs), rohitrao (ping after 24h)
Visibility:
Public.

Description

Introduces a search term extraction mechanism working for arbitrary search providers. Repalces the omnibox content with the actual search term when searching on the user's default search engine. Meant to be used with instant extended. Note: Will only convert URLs that have the espv=1 query parameter. BUG=139176, 135106 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=160884

Patch Set 1 : #

Patch Set 2 : Rebased #

Total comments: 13

Patch Set 3 : Fixed dominich comments. #

Total comments: 4

Patch Set 4 : Added alternate_urls to pref, sync and policy. #

Patch Set 5 : rebased #

Total comments: 12

Patch Set 6 : Answered code review comments. #

Total comments: 8

Patch Set 7 : Removed custom comma-separated serialization. #

Patch Set 8 : Fixed keyword_table_unittest #

Total comments: 37

Patch Set 9 : Answered comments, added a test to policy_browsertest #

Patch Set 10 : Removed need for espv=1 for search term extraction. #

Total comments: 72

Patch Set 11 : Answered PK's comments. #

Patch Set 12 : #

Total comments: 5

Patch Set 13 : Indent fix. #

Total comments: 12

Patch Set 14 : Answered PK's comments. #

Total comments: 2

Patch Set 15 : Removed version_46.sql, committed separately. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+950 lines, -275 lines) Patch
M chrome/app/policy/policy_templates.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +19 lines, -1 line 0 comments Download
M chrome/browser/google/google_util.h View 1 2 3 4 5 6 7 8 2 chunks +0 lines, -4 lines 0 comments Download
M chrome/browser/google/google_util.cc View 1 2 3 4 5 6 7 8 3 chunks +0 lines, -45 lines 0 comments Download
M chrome/browser/google/google_util_unittest.cc View 6 7 8 1 chunk +0 lines, -50 lines 0 comments Download
M chrome/browser/policy/configuration_policy_handler.h View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -1 line 0 comments Download
M chrome/browser/policy/configuration_policy_handler.cc View 1 2 3 4 5 6 4 chunks +15 lines, -0 lines 0 comments Download
M chrome/browser/policy/configuration_policy_pref_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +81 lines, -69 lines 0 comments Download
M chrome/browser/policy/policy_browsertest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +80 lines, -0 lines 0 comments Download
M chrome/browser/search_engines/template_url.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +48 lines, -3 lines 0 comments Download
M chrome/browser/search_engines/template_url.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +138 lines, -21 lines 0 comments Download
M chrome/browser/search_engines/template_url_prepopulate_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 183 chunks +209 lines, -3 lines 0 comments Download
M chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/search_engines/template_url_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +20 lines, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_service_factory.cc View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/search_engines/template_url_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +101 lines, -0 lines 0 comments Download
M chrome/browser/ui/toolbar/toolbar_model.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +18 lines, -9 lines 0 comments Download
M chrome/browser/ui/toolbar/toolbar_model_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -8 lines 0 comments Download
M chrome/browser/webdata/keyword_table.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +9 lines, -4 lines 0 comments Download
M chrome/browser/webdata/keyword_table.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 18 chunks +109 lines, -44 lines 0 comments Download
M chrome/browser/webdata/keyword_table_unittest.cc View 1 2 3 4 5 6 7 4 chunks +12 lines, -5 lines 0 comments Download
M chrome/browser/webdata/web_database.cc View 1 2 3 4 5 3 chunks +10 lines, -3 lines 0 comments Download
M chrome/browser/webdata/web_database_migration_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +49 lines, -4 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/test/data/policy/policy_test_cases.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -0 lines 0 comments Download
M sync/protocol/proto_value_conversions.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M sync/protocol/search_engine_specifics.proto View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 46 (0 generated)
beaudoin
Here's my first take on this. It doesn't yet support an {anything} wildcard to ignore ...
8 years, 3 months ago (2012-09-12 21:02:19 UTC) #1
dhollowa
With the changes to webdata, you'll need to make similar schema changes for sync. I.e. ...
8 years, 3 months ago (2012-09-12 22:00:39 UTC) #2
dominich
http://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url.cc File chrome/browser/search_engines/template_url.cc (right): http://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url.cc#newcode442 chrome/browser/search_engines/template_url.cc:442: url.path() != path_) nit: add braces here http://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url_prepopulate_data.cc File ...
8 years, 3 months ago (2012-09-12 22:23:12 UTC) #3
beaudoin
Fixed dominich@ comments. Working on implementing changes to sync as mentioned by dhollowa@. http://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url.cc File ...
8 years, 3 months ago (2012-09-13 18:16:45 UTC) #4
Peter Kasting
http://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url_prepopulate_data.cc File chrome/browser/search_engines/template_url_prepopulate_data.cc (right): http://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url_prepopulate_data.cc#newcode57 chrome/browser/search_engines/template_url_prepopulate_data.cc:57: // Comma separated list of URL patterns that can ...
8 years, 3 months ago (2012-09-13 18:22:08 UTC) #5
dominich
https://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url_prepopulate_data.cc File chrome/browser/search_engines/template_url_prepopulate_data.cc (right): https://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url_prepopulate_data.cc#newcode57 chrome/browser/search_engines/template_url_prepopulate_data.cc:57: // Comma separated list of URL patterns that can ...
8 years, 3 months ago (2012-09-13 18:30:30 UTC) #6
beaudoin
http://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url_prepopulate_data.cc File chrome/browser/search_engines/template_url_prepopulate_data.cc (right): http://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url_prepopulate_data.cc#newcode57 chrome/browser/search_engines/template_url_prepopulate_data.cc:57: // Comma separated list of URL patterns that can ...
8 years, 3 months ago (2012-09-13 18:31:49 UTC) #7
dominich
On Thu, Sep 13, 2012 at 11:31 AM, <[email protected]> wrote: > > http://codereview.chromium.**org/10908226/diff/7001/chrome/** > browser/search_engines/**template_url_prepopulate_data.**cc<http://codereview.chromium.org/10908226/diff/7001/chrome/browser/search_engines/template_url_prepopulate_data.cc> ...
8 years, 3 months ago (2012-09-13 18:34:19 UTC) #8
Peter Kasting
On 2012/09/13 18:34:19, dominich wrote: > > Ok, right now it fails to match which ...
8 years, 3 months ago (2012-09-13 18:38:22 UTC) #9
dominich
On Thu, Sep 13, 2012 at 11:38 AM, <[email protected]> wrote: > On 2012/09/13 18:34:19, dominich ...
8 years, 3 months ago (2012-09-13 18:41:07 UTC) #10
dominich
http://codereview.chromium.org/10908226/diff/11002/chrome/browser/ui/toolbar/toolbar_model.cc File chrome/browser/ui/toolbar/toolbar_model.cc (right): http://codereview.chromium.org/10908226/diff/11002/chrome/browser/ui/toolbar/toolbar_model.cc#newcode203 chrome/browser/ui/toolbar/toolbar_model.cc:203: if (!profile || !chrome::search::IsInstantExtendedAPIEnabled(profile)) One more thought (from a ...
8 years, 3 months ago (2012-09-14 21:34:04 UTC) #11
beaudoin
@David As suggested, I added alternate_urls to sync and pref. I've also added them to ...
8 years, 3 months ago (2012-09-15 02:29:26 UTC) #12
beaudoin
Addedum... For future CLs: - Ensure TemplateURLService::UpdateKeywordSearchTermsForURL uses the same search term extraction mechanism as ...
8 years, 3 months ago (2012-09-15 02:37:00 UTC) #13
dhollowa
http://codereview.chromium.org/10908226/diff/5004/chrome/browser/search_engines/template_url.h File chrome/browser/search_engines/template_url.h (right): http://codereview.chromium.org/10908226/diff/5004/chrome/browser/search_engines/template_url.h#newcode366 chrome/browser/search_engines/template_url.h:366: // |instant_url|, to extract search terms from a URL. ...
8 years, 3 months ago (2012-09-19 19:51:03 UTC) #14
beaudoin
+joaodasilva for policy +lipalani for sync +sky for browser Pushed a new set of changes ...
8 years, 3 months ago (2012-09-22 06:55:45 UTC) #15
Peter Kasting
I'm still opposed to any solution that involves parsing a string for comma-separated URLs.
8 years, 3 months ago (2012-09-23 02:03:33 UTC) #16
beaudoin1
Proposal: Serialize the list in a fancier way (any helper string list serialization code in ...
8 years, 3 months ago (2012-09-23 02:37:50 UTC) #17
Peter Kasting
On Sat, Sep 22, 2012 at 7:37 PM, Philippe Beaudoin <[email protected]>wrote: > Proposal: Serialize the ...
8 years, 3 months ago (2012-09-24 05:29:29 UTC) #18
Joao da Silva
The pref should be a ListValue instead of a comma-separated list of strings in a ...
8 years, 3 months ago (2012-09-24 09:12:29 UTC) #19
beaudoin
Summary of changes in that latest version: - Made the alternate_urls pref a ListValue - ...
8 years, 2 months ago (2012-09-27 17:37:13 UTC) #20
Joao da Silva
policy changes LGTM. It'd be extra cool to have a test in src/chrome/browser/policy/policy_browsertest.cc for this ...
8 years, 2 months ago (2012-09-28 11:46:10 UTC) #21
dhollowa
http://codereview.chromium.org/10908226/diff/38002/chrome/browser/google/google_util.h File chrome/browser/google/google_util.h (left): http://codereview.chromium.org/10908226/diff/38002/chrome/browser/google/google_util.h#oldcode22 chrome/browser/google/google_util.h:22: // The query key that identifies a Google Extended ...
8 years, 2 months ago (2012-09-28 18:06:29 UTC) #22
beaudoin
Summary of changes: - Answered all review comments. - Added a test for search term ...
8 years, 2 months ago (2012-10-02 17:43:28 UTC) #23
dhollowa
LGTM. Thanks for persevering! http://codereview.chromium.org/10908226/diff/38002/chrome/browser/google/google_util.h File chrome/browser/google/google_util.h (left): http://codereview.chromium.org/10908226/diff/38002/chrome/browser/google/google_util.h#oldcode89 chrome/browser/google/google_util.h:89: bool IsInstantExtendedAPIGoogleSearchUrl(const std::string& url); On ...
8 years, 2 months ago (2012-10-02 18:14:13 UTC) #24
beaudoin
On 2012/10/02 18:14:13, dhollowa wrote: > LGTM. Thanks for persevering! > > http://codereview.chromium.org/10908226/diff/38002/chrome/browser/google/google_util.h > File ...
8 years, 2 months ago (2012-10-02 18:49:22 UTC) #25
dhollowa
On 2012/10/02 18:49:22, beaudoin wrote: > On 2012/10/02 18:14:13, dhollowa wrote: > > LGTM. Thanks ...
8 years, 2 months ago (2012-10-02 19:21:02 UTC) #26
beaudoin
On 2012/10/02 19:21:02, dhollowa wrote: > Ya, that is wrong. The only test should be ...
8 years, 2 months ago (2012-10-02 20:25:27 UTC) #27
dhollowa
On 2012/10/02 20:25:27, beaudoin wrote: > On 2012/10/02 19:21:02, dhollowa wrote: > > Ya, that ...
8 years, 2 months ago (2012-10-02 20:38:10 UTC) #28
Peter Kasting
I finally stopped putting it off and reviewed this thing :). Luckily the previous review ...
8 years, 2 months ago (2012-10-02 21:47:59 UTC) #29
beaudoin
Summary of changes: - Fixed or discussed all of PK's nits - Fixed broken tests ...
8 years, 2 months ago (2012-10-03 22:46:52 UTC) #30
Peter Kasting
http://codereview.chromium.org/10908226/diff/60001/chrome/browser/search_engines/template_url.cc File chrome/browser/search_engines/template_url.cc (right): http://codereview.chromium.org/10908226/diff/60001/chrome/browser/search_engines/template_url.cc#newcode133 chrome/browser/search_engines/template_url.cc:133: DCHECK(type_ != INDEXED); On 2012/10/03 22:46:52, beaudoin wrote: > ...
8 years, 2 months ago (2012-10-03 22:59:32 UTC) #31
beaudoin
http://codereview.chromium.org/10908226/diff/60001/chrome/browser/search_engines/template_url.h File chrome/browser/search_engines/template_url.h (right): http://codereview.chromium.org/10908226/diff/60001/chrome/browser/search_engines/template_url.h#newcode45 chrome/browser/search_engines/template_url.h:45: // |index_in_owner_| should be used instead. On 2012/10/03 22:59:33, ...
8 years, 2 months ago (2012-10-04 00:03:58 UTC) #32
Joao da Silva
Still LGTM. Thanks for the new test! http://codereview.chromium.org/10908226/diff/73002/chrome/browser/policy/configuration_policy_pref_store_unittest.cc File chrome/browser/policy/configuration_policy_pref_store_unittest.cc (right): http://codereview.chromium.org/10908226/diff/73002/chrome/browser/policy/configuration_policy_pref_store_unittest.cc#newcode732 chrome/browser/policy/configuration_policy_pref_store_unittest.cc:732: base::Value::CreateStringValue(bad_search_url)); nit: ...
8 years, 2 months ago (2012-10-04 14:45:37 UTC) #33
beaudoin
http://codereview.chromium.org/10908226/diff/73002/chrome/browser/policy/configuration_policy_pref_store_unittest.cc File chrome/browser/policy/configuration_policy_pref_store_unittest.cc (right): http://codereview.chromium.org/10908226/diff/73002/chrome/browser/policy/configuration_policy_pref_store_unittest.cc#newcode732 chrome/browser/policy/configuration_policy_pref_store_unittest.cc:732: base::Value::CreateStringValue(bad_search_url)); On 2012/10/04 14:45:37, Joao da Silva wrote: > ...
8 years, 2 months ago (2012-10-04 15:39:29 UTC) #34
Peter Kasting
LGTM http://codereview.chromium.org/10908226/diff/60001/chrome/browser/webdata/web_database_migration_unittest.cc File chrome/browser/webdata/web_database_migration_unittest.cc (right): http://codereview.chromium.org/10908226/diff/60001/chrome/browser/webdata/web_database_migration_unittest.cc#newcode2214 chrome/browser/webdata/web_database_migration_unittest.cc:2214: // if the former is smaller. On 2012/10/03 ...
8 years, 2 months ago (2012-10-04 19:32:43 UTC) #35
beaudoin
Answered this last round of comments. It's coming to an end! :) OWNERS review needed ...
8 years, 2 months ago (2012-10-04 23:10:44 UTC) #36
sky
http://codereview.chromium.org/10908226/diff/83001/chrome/browser/webdata/keyword_table.cc File chrome/browser/webdata/keyword_table.cc (right): http://codereview.chromium.org/10908226/diff/83001/chrome/browser/webdata/keyword_table.cc#newcode89 chrome/browser/webdata/keyword_table.cc:89: // Serialize |alternate_urls| to JSON. Serializing to JSON is ...
8 years, 2 months ago (2012-10-05 15:31:32 UTC) #37
beaudoin1
http://codereview.chromium.org/10908226/diff/83001/chrome/browser/webdata/keyword_table.cc File chrome/browser/webdata/keyword_table.cc (right): http://codereview.chromium.org/10908226/diff/83001/chrome/browser/webdata/keyword_table.cc#newcode89 chrome/browser/webdata/keyword_table.cc:89: // Serialize |alternate_urls| to JSON. On 2012/10/05 15:31:32, sky ...
8 years, 2 months ago (2012-10-05 17:04:11 UTC) #38
sky
Can it contain \0 ? -Scott On Fri, Oct 5, 2012 at 10:04 AM, <[email protected]> ...
8 years, 2 months ago (2012-10-05 17:14:14 UTC) #39
beaudoin1
@pkasting: Would you be fine using \0 as a separator? On 2012/10/05 17:14:14, sky wrote: ...
8 years, 2 months ago (2012-10-05 17:30:14 UTC) #40
Peter Kasting
On Fri, Oct 5, 2012 at 10:30 AM, <[email protected]> wrote: > @pkasting: Would you be ...
8 years, 2 months ago (2012-10-05 17:32:23 UTC) #41
sky
Fair enough, LGTM
8 years, 2 months ago (2012-10-05 20:37:56 UTC) #42
beaudoin
+akalin, atwilson I really need that LGTM for sync/ pretty please? :)
8 years, 2 months ago (2012-10-05 22:15:56 UTC) #43
akalin
sync lgtm
8 years, 2 months ago (2012-10-05 23:01:41 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10908226/75006
8 years, 2 months ago (2012-10-09 17:53:14 UTC) #45
commit-bot: I haz the power
8 years, 2 months ago (2012-10-09 18:54:25 UTC) #46
Change committed as 160884

Powered by Google App Engine
This is Rietveld 408576698