summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_popup.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-12 19:32:49 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-12 19:32:49 +0000
commita4ffa8cf38d76e3ed86f55e5abe5bb9650fb6383 (patch)
tree048ebe6de0e34afd23a449704919f6fbe8a137c1 /chrome/browser/autocomplete/autocomplete_popup.cc
parent9603c8e626c6818e92368904b9b5d8d21191d376 (diff)
downloadchromium_src-a4ffa8cf38d76e3ed86f55e5abe5bb9650fb6383.zip
chromium_src-a4ffa8cf38d76e3ed86f55e5abe5bb9650fb6383.tar.gz
chromium_src-a4ffa8cf38d76e3ed86f55e5abe5bb9650fb6383.tar.bz2
Omnibox metrics logging patch splitout, part 3: Pass match.type to the edit and let it make the determination about showing the search hint, instead of making the determination in the popup.
In the ultimate patch, the types on which we'll show the hint will expand, so this saved duplicating some logic at points in the popup; in retrospect it makes more sense anyway, since there's no reason for the popup to know anything about the search hint. That's more the edit's job anyway. Review URL: http://codereview.chromium.org/10839 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5276 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_popup.cc')
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup.cc b/chrome/browser/autocomplete/autocomplete_popup.cc
index 9b61383..5a457c9 100644
--- a/chrome/browser/autocomplete/autocomplete_popup.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup.cc
@@ -751,8 +751,7 @@ void AutocompletePopupModel::SetSelectedLine(size_t line,
const bool is_keyword_hint = GetKeywordForMatch(match, &keyword);
edit_model_->OnPopupDataChanged(
reset_to_default ? std::wstring() : match.fill_into_edit,
- !reset_to_default, keyword, is_keyword_hint,
- (match.type == AutocompleteMatch::SEARCH));
+ !reset_to_default, keyword, is_keyword_hint, match.type);
// Repaint old and new selected lines immediately, so that the edit doesn't
// appear to update [much] faster than the popup. We must not update
@@ -952,7 +951,7 @@ void AutocompletePopupModel::Observe(NotificationType type,
std::wstring inline_autocomplete_text;
std::wstring keyword;
bool is_keyword_hint = false;
- bool can_show_search_hint = true;
+ AutocompleteMatch::Type type = AutocompleteMatch::SEARCH;
const AutocompleteResult::const_iterator match(result.default_match());
if (match != result.end()) {
if ((match->inline_autocomplete_offset != std::wstring::npos) &&
@@ -968,10 +967,10 @@ void AutocompletePopupModel::Observe(NotificationType type,
// the OS DNS cache could suffer eviction problems for minimal gain.
is_keyword_hint = GetKeywordForMatch(*match, &keyword);
- can_show_search_hint = (match->type == AutocompleteMatch::SEARCH);
+ type = match->type;
}
edit_model_->OnPopupDataChanged(inline_autocomplete_text, false, keyword,
- is_keyword_hint, can_show_search_hint);
+ is_keyword_hint, type);
return;
}