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

Issue 6995096: Update BuiltinProvider to use chrome:// URLs. (Closed)

Created:
9 years, 6 months ago by msw
Modified:
9 years, 6 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews
Visibility:
Public.

Description

Update BuiltinProvider to provide chrome:// URLs. Provide common URLs as users start typing "about://" or "chrome://". Highlight matching input (including "chrome://" for "about:" input). Support settings sub-pages/paths, e.g. "chrome://settings/foo". Add BuiltinProviderTest unit test. Additional hosts will be added when I fix crbug.com/73926. BUG=55771 TEST=Get chrome:// AutocompleteProvider URLs in the omnibox dropdown. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=89073 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=89298 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=89356

Patch Set 1 #

Patch Set 2 : Support about: and chrome: URLs. #

Patch Set 3 : Improve highlighting, refactor matching, code cleanup. #

Patch Set 4 : Add support for settings sub-pages. #

Total comments: 18

Patch Set 5 : Address comments, add builtin_provider_unittest.cc and supporting changes. #

Total comments: 11

Patch Set 6 : Address comments, remove unused var in test. #

Patch Set 7 : Fix BuiltinProviderTest.ChromeSettingsSubpages for chromeos. #

Patch Set 8 : Update tests after kChromeUICryptohomeHost was added. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -24 lines) Patch
M chrome/browser/autocomplete/builtin_provider.h View 1 2 3 4 5 3 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/builtin_provider.cc View 1 2 3 4 5 3 chunks +89 lines, -18 lines 0 comments Download
A chrome/browser/autocomplete/builtin_provider_unittest.cc View 1 2 3 4 5 6 7 1 chunk +228 lines, -0 lines 0 comments Download
M chrome/browser/browser_about_handler.cc View 1 2 3 4 5 6 7 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/url_constants.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/url_constants.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/canvas.h View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
msw
PTAL; thanks.
9 years, 6 months ago (2011-06-08 23:54:55 UTC) #1
Peter Kasting
Hmmm. So, the problem with this is that it will help users who type "chrome://foo" ...
9 years, 6 months ago (2011-06-09 00:45:59 UTC) #2
msw
Done; PTAL. Also, I'd appreciate feedback on optional polish opportunities: -Highlight "foo" in "chrome://foobar" result ...
9 years, 6 months ago (2011-06-10 02:27:37 UTC) #3
msw
I improved parsing and highlighting, added settings sub-page support, and refactored a bit for cleanup. ...
9 years, 6 months ago (2011-06-10 10:48:51 UTC) #4
Peter Kasting
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/builtin_provider.cc File chrome/browser/autocomplete/builtin_provider.cc (right): http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/builtin_provider.cc#newcode15 chrome/browser/autocomplete/builtin_provider.cc:15: const string16 kAbout = ASCIIToUTF16(chrome::kAboutScheme) + Declaring global instances ...
9 years, 6 months ago (2011-06-10 18:50:35 UTC) #5
msw
PTAL (addressed comments, added unit tests, supporting changes); thanks! http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/builtin_provider.cc File chrome/browser/autocomplete/builtin_provider.cc (right): http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/builtin_provider.cc#newcode15 chrome/browser/autocomplete/builtin_provider.cc:15: ...
9 years, 6 months ago (2011-06-11 21:49:48 UTC) #6
Peter Kasting
LGTM http://codereview.chromium.org/6995096/diff/6003/chrome/browser/autocomplete/builtin_provider.cc File chrome/browser/autocomplete/builtin_provider.cc (right): http://codereview.chromium.org/6995096/diff/6003/chrome/browser/autocomplete/builtin_provider.cc#newcode79 chrome/browser/autocomplete/builtin_provider.cc:79: static const size_t kAboutLength = strlen(chrome::kAboutScheme); Nit: Naming ...
9 years, 6 months ago (2011-06-14 20:18:33 UTC) #7
msw
9 years, 6 months ago (2011-06-14 21:32:15 UTC) #8
Done, also included a minor correction in ui/gfx/canvas.h, sort of accidentally
:)

http://codereview.chromium.org/6995096/diff/6003/chrome/browser/autocomplete/...
File chrome/browser/autocomplete/builtin_provider.cc (right):

http://codereview.chromium.org/6995096/diff/6003/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:79: static const size_t
kAboutLength = strlen(chrome::kAboutScheme);
On 2011/06/14 20:18:33, Peter Kasting wrote:
> Nit: Naming this |kAboutSchemeLength| might help convey that this is not the
> same as the length of |kAbout|.
> 
> Another route might instead be to name |kAbout| to e.g. |kAboutWithSeparators|
> and similarly adjust kChrome and all related variables, but that might get
> really verbose.

Done.

http://codereview.chromium.org/6995096/diff/6003/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:83:
styles.push_back(ACMatchClassification(offset, kUrl));
On 2011/06/14 20:18:33, Peter Kasting wrote:
> Nit: Seems like you should only do this when |highlight| is true.

Done.

http://codereview.chromium.org/6995096/diff/6003/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:96: (i != builtins_.end()) &&
(matches_.size() < kMaxMatches); ++i) {
On 2011/06/14 20:18:33, Peter Kasting wrote:
> Nit: Indent 2 more

Done.

http://codereview.chromium.org/6995096/diff/6003/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:101: size_t match_length =
kChrome.length() + host_and_path.length();
On 2011/06/14 20:18:33, Peter Kasting wrote:
> Nit: This temp can be hoisted above the loop too, no?

Done.

http://codereview.chromium.org/6995096/diff/6003/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:114: void
BuiltinProvider::AddMatch(const string16& input,
On 2011/06/14 20:18:33, Peter Kasting wrote:
> Nit: This argument is never used.
> 
> Seems like |input| and |match_string| should be replaced with the text to put
> into match.fill_into_edit, which the caller already sort of has to calculate
> (kChrome + *i).

Done.

Powered by Google App Engine
This is Rietveld 408576698