9 years, 6 months ago
(2011-06-08 23:54:55 UTC)
#1
PTAL; thanks.
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
Hmmm. So, the problem with this is that it will help users who type
"chrome://foo" but not users who type "about:foo". Seems like we should
probably try to assist both forms?
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
Done; PTAL. Also, I'd appreciate feedback on optional polish opportunities:
-Highlight "foo" in "chrome://foobar" result if user types "about:foo".
-Highlight "chrome://foo" if the user types extra (slash, path, query, ref,
etc.).
-Support settings sub-pages/paths "chrome://settings/foo".
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
I improved parsing and highlighting, added settings sub-page support, and
refactored a bit for cleanup. PTAL, thanks!
9 years, 6 months ago
(2011-06-11 21:49:48 UTC)
#6
PTAL (addressed comments, added unit tests, supporting changes); thanks!
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/...
File chrome/browser/autocomplete/builtin_provider.cc (right):
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:15: const string16 kAbout =
ASCIIToUTF16(chrome::kAboutScheme) +
On 2011/06/10 18:50:35, Peter Kasting wrote:
> Declaring global instances of strings violates the style guide. These have to
> be char* or non-global-scope.
>
> I'd probably just create them within the functions that use them, there won't
be
> a discernable speed hit.
Done.
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:22: const int kMatch =
ACMatchClassification::URL | ACMatchClassification::MATCH;
On 2011/06/10 18:50:35, Peter Kasting wrote:
> Nit: I'd probably declare these in the function where they're used, too, to
> scope them as narrowly as possible.
Done.
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:24: // This list should be kept
in sync with chrome/common/url_constnats.h.
On 2011/06/10 18:50:35, Peter Kasting wrote:
> Nit: constnats -> constants. Would it make sense to have this list over in
that
> header instead?
Fixed constants, the list isn't used elsewhere, so I'll keep it here for now.
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:25: const char
*kChromeSettingsSubPages[] = {
On 2011/06/10 18:50:35, Peter Kasting wrote:
> Nit: * goes on type, not name
Done. Also fixed browser_about_handler.cc.
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:58:
settings.append(ASCIIToUTF16("/"));
On 2011/06/10 18:50:35, Peter Kasting wrote:
> Nit: Or you could just do "... + '/'" in the previous initializer, I think
that
> ought to work.
Done (sorta, can't add ASCII char/string to string16/char[] afaik).
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:79: bool highlight =
starting_chrome || text.length() > kAboutLength;
On 2011/06/10 18:50:35, Peter Kasting wrote:
> How can text.length() be larger than |kAboutLength|, when |kAbout| starts with
> |text|?
If the user typed |text| "about:", "about:/", or "about://" then it's longer
than |chrome::kAboutScheme| "about", and I'll highlight the "chrome://". I
adjusted the comment for clarity.
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:93: // Include the path for
sub-pages (e.g. "chrome://settings/browser").
On 2011/06/10 18:50:35, Peter Kasting wrote:
> Shouldn't this whole |host_and_path| construction be hoisted outside this
inner
> loop?
Done.
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:95:
host_and_path.append(UTF8ToUTF16(fixed_url.path()));
On 2011/06/10 18:50:35, Peter Kasting wrote:
> Nit: I'd just combine these two lines using the + operator
Done.
http://codereview.chromium.org/6995096/diff/2002/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:98: host_and_path =
host_and_path.substr(0, host_and_path.length()-1);
On 2011/06/10 18:50:35, Peter Kasting wrote:
> Nit: Spaces around operator
Done.
http://codereview.chromium.org/6995096/diff/6003/chrome/browser/autocomplete/...
chrome/browser/autocomplete/builtin_provider.cc:46: } // namespace
Outdented one space.
Done, also included a minor correction in ui/gfx/canvas.h, sort of accidentally :) http://codereview.chromium.org/6995096/diff/6003/chrome/browser/autocomplete/builtin_provider.cc File chrome/browser/autocomplete/builtin_provider.cc ...
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.
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
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 29