diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-14 16:47:26 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-14 16:47:26 +0000 |
commit | bb5276425eba1ae57a0eb120c6caf6d689d7f935 (patch) | |
tree | 471ac45b1999005695a046517ae21e33a1a63be5 /chrome/browser/autocomplete/autocomplete.h | |
parent | f1a5a90c6b5edd54b239fd15eac71fbbc153ec97 (diff) | |
download | chromium_src-bb5276425eba1ae57a0eb120c6caf6d689d7f935.zip chromium_src-bb5276425eba1ae57a0eb120c6caf6d689d7f935.tar.gz chromium_src-bb5276425eba1ae57a0eb120c6caf6d689d7f935.tar.bz2 |
Reworks autocomplete result set processing by the edit/model necessitated by my last change (only one result set vs 2). There is now one notification when the results change. The edit is the sole listener and updates the popup after it does some processing.
My last change broke keyword state when switching tabs. This is because of the change I did to AutocompleteEditModel::SetUserText, specifically:
keyword_.clear();
is_keyword_hint_ = false;
When you restore a tab we end up in
void AutocompleteEditModel::RestoreState(const State& state) {
...
keyword_ = state.keyword;
is_keyword_hint_ = state.is_keyword_hint;
view_->SetUserText(state.user_text,
DisplayTextFromUserText(state.user_text), false);
Which ends up back in SetUserText and we because of my change the
keyword is effectively chucked.
I added the code to clear out the keyword because of the change of
notifications. Specifically because AutocompletePopupModel::Observe is
now notified before AutocompleteEditModel::Observe yet it expects the
AutocompleteEditModel to have been updated.
Additionally I need to update the keyword_ and keyword_hint_ immediately in the edit if the results go empty. This mirrors what the old code was doing.
BUG=72022
TEST=covered by tests
Review URL: http://codereview.chromium.org/6484015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete.h')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.h b/chrome/browser/autocomplete/autocomplete.h index ea6382c..148209f 100644 --- a/chrome/browser/autocomplete/autocomplete.h +++ b/chrome/browser/autocomplete/autocomplete.h @@ -615,12 +615,10 @@ class AutocompleteController : public ACProviderListener { // return matches which are synchronously available, which should mean that // all providers will be done immediately. // - // The controller will fire AUTOCOMPLETE_CONTROLLER_DEFAULT_MATCH_UPDATED from - // inside this call, and unless the query is stopped, will fire at least one - // (and perhaps more) AUTOCOMPLETE_CONTROLLER_RESULT_UPDATED later as more - // matches come in (even if the query completes synchronously). Listeners - // should use the result set provided in the accompanying Details object to - // update themselves. + // The controller will fire AUTOCOMPLETE_CONTROLLER_RESULT_UPDATED from + // inside this call at least once. If matches are available later on that + // result in changing the result set AUTOCOMPLETE_CONTROLLER_RESULT_UPDATED + // is sent again. void Start(const string16& text, const string16& desired_tld, bool prevent_inline_autocomplete, |