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

Unified Diff: chrome/browser/autocomplete/autocomplete_popup_model.cc

Issue 119116: Fix crash due to AutocompletePopup trying to draw the old results when they w... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.cc ('k') | chrome/browser/autocomplete/autocomplete_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_popup_model.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete_popup_model.cc (revision 17436)
+++ chrome/browser/autocomplete/autocomplete_popup_model.cc (working copy)
@@ -250,7 +250,7 @@
if (IsOpen() && !controller_->done()) {
Observe(NotificationType::AUTOCOMPLETE_CONTROLLER_RESULT_UPDATED,
Source<AutocompleteController>(controller_.get()),
- NotificationService::NoDetails());
+ Details<const AutocompleteResult>(&controller_->result()));
}
const AutocompleteResult& result = controller_->result();
@@ -296,15 +296,16 @@
if (inside_synchronous_query_)
return;
- const AutocompleteResult& result = controller_->result();
+ const AutocompleteResult* result =
+ Details<const AutocompleteResult>(details).ptr();
switch (type.value) {
case NotificationType::AUTOCOMPLETE_CONTROLLER_RESULT_UPDATED: {
- selected_line_ = (result.default_match() == result.end()) ?
- kNoMatch : (result.default_match() - result.begin());
+ selected_line_ = (result->default_match() == result->end()) ?
+ kNoMatch : (result->default_match() - result->begin());
// If we're going to trim the window size to no longer include the hovered
// line, turn hover off. Practically, this shouldn't happen, but it
// doesn't hurt to be defensive.
- if ((hovered_line_ != kNoMatch) && (result.size() <= hovered_line_))
+ if ((hovered_line_ != kNoMatch) && (result->size() <= hovered_line_))
SetHoveredLine(kNoMatch);
view_->UpdatePopupAppearance();
@@ -321,8 +322,8 @@
std::wstring keyword;
bool is_keyword_hint = false;
AutocompleteMatch::Type type = AutocompleteMatch::SEARCH_WHAT_YOU_TYPED;
- const AutocompleteResult::const_iterator match(result.default_match());
- if (match != result.end()) {
+ const AutocompleteResult::const_iterator match(result->default_match());
+ if (match != result->end()) {
if ((match->inline_autocomplete_offset != std::wstring::npos) &&
(match->inline_autocomplete_offset <
match->fill_into_edit.length())) {
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.cc ('k') | chrome/browser/autocomplete/autocomplete_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698