Chromium Code Reviews| Index: chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc |
| =================================================================== |
| --- chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc (revision 80868) |
| +++ chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc (working copy) |
| @@ -266,7 +266,12 @@ |
| } |
| void AutocompletePopupContentsView::InvalidateLine(size_t line) { |
| - GetChildViewAt(static_cast<int>(line))->SchedulePaint(); |
| + AutocompleteResultView* result_view = |
| + static_cast<AutocompleteResultView*>(GetChildViewAt( |
| + static_cast<int>(line))); |
| + |
| + result_view->SetMatch(GetMatchAtIndex(line)); |
| + result_view->SchedulePaint(); |
| } |
| void AutocompletePopupContentsView::UpdatePopupAppearance() { |
| @@ -301,7 +306,7 @@ |
| result_view = static_cast<AutocompleteResultView*>(GetChildViewAt(i)); |
| result_view->SetVisible(true); |
| } |
| - result_view->set_match(GetMatchAtIndex(i)); |
| + result_view->SetMatch(GetMatchAtIndex(i)); |
| } |
| for (size_t i = model_->result().size(); i < child_rv_count; ++i) |
| GetChildViewAt(i)->SetVisible(false); |
| @@ -623,9 +628,14 @@ |
| // OpenURL() may close the popup, which will clear the result set and, by |
| // extension, |match| and its contents. So copy the relevant strings out to |
| // make sure they stay alive until the call completes. |
| + string16 keyword; |
|
Peter Kasting
2011/04/11 23:17:33
Nit: Rewrite from here down as:
const GURL url(
|
| + bool is_keyword_hint = false; |
| + |
| + if (match.keyword.get()) { |
| + keyword = match.keyword->text; |
| + is_keyword_hint = match.keyword->is_keyword_hint; |
| + } |
| const GURL url(match.destination_url); |
| - string16 keyword; |
| - const bool is_keyword_hint = model_->GetKeywordForMatch(match, &keyword); |
| edit_view_->OpenURL(url, disposition, match.transition, GURL(), index, |
| is_keyword_hint ? string16() : keyword); |
| } |