Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_controller.h |
| diff --git a/chrome/browser/autocomplete/autocomplete_controller.h b/chrome/browser/autocomplete/autocomplete_controller.h |
| index d0466c7ecb9a18ccfb4f816f073c8735d7cae555..c202164a3c64394b57eeec8fe1eed8f0357c29b9 100644 |
| --- a/chrome/browser/autocomplete/autocomplete_controller.h |
| +++ b/chrome/browser/autocomplete/autocomplete_controller.h |
| @@ -9,6 +9,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/gtest_prod_util.h" |
| #include "base/string16.h" |
| +#include "base/time.h" |
| #include "base/timer.h" |
| #include "chrome/browser/autocomplete/autocomplete_input.h" |
| #include "chrome/browser/autocomplete/autocomplete_provider.h" |
| @@ -125,6 +126,10 @@ class AutocompleteController : public AutocompleteProviderListener { |
| bool done() const { return done_; } |
| const ACProviders* providers() const { return &providers_; } |
| + base::TimeTicks last_time_default_match_changed() const { |
|
Peter Kasting
2012/11/16 23:57:18
Nit: return class objects by const & where possibl
Mark P
2012/11/19 22:21:45
Good idea.
|
| + return last_time_default_match_changed_; |
| + } |
| + |
| // AutocompleteProviderListener: |
| virtual void OnProviderUpdate(bool updated_matches) OVERRIDE; |
| @@ -142,10 +147,14 @@ class AutocompleteController : public AutocompleteProviderListener { |
| RedundantKeywordsIgnoredInResult); |
| FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, UpdateAssistedQueryStats); |
| - // Updates |result_| to reflect the current provider state. Resets timers and |
| - // fires notifications as necessary. |is_synchronous_pass| is true only when |
| - // Start() is calling this to get the synchronous result. |
| - void UpdateResult(bool is_synchronous_pass); |
| + // Updates |result_| to reflect the current provider state and fires |
| + // notifications. If |regenerate_result| then we clear the result |
| + // so when we incorporate the current provider state we end up |
| + // implicitly removing all expired matches. If |
| + // |force_notify_default_match_changed|, we tell NotifyChanged the |
| + // default match has changed even if it hasn't. |
|
Peter Kasting
2012/11/16 23:57:18
Nit: May want to motivate this last sentence with
Mark P
2012/11/19 22:21:45
Done.
|
| + void UpdateResult(bool regenerate_result, |
| + bool force_notify_default_match_changed); |
| // Updates |result| to populate each match's |associated_keyword| if that |
| // match can show a keyword hint. |result| should be sorted by |
| @@ -188,6 +197,18 @@ class AutocompleteController : public AutocompleteProviderListener { |
| // Data from the autocomplete query. |
| AutocompleteResult result_; |
| + // The most recent time the default match (inline match) changed. This may |
| + // be earlier than the most recent keystroke if the recent keystrokes didn't |
| + // change the suggested match in the omnibox. (For instance, if |
| + // a user typed "mail.goog" and the match https://mail.google.com/ was |
| + // the destination match ever since the user typed "ma" then this time |
| + // corresponds to the first instance https://mail.google.com/ first |
|
Bart N.
2012/11/19 18:02:21
Nit: remove second "first".
Mark P
2012/11/19 22:21:45
Done.
|
| + // appeared as the default match.) This also be me more recent than the |
|
Peter Kasting
2012/11/16 23:57:18
Nit: extra "me"
Bart N.
2012/11/19 18:02:21
Nit: move dot outside parenthese.
Mark P
2012/11/19 22:21:45
Let's as-is. The parenthetical remark is a full s
Mark P
2012/11/19 22:21:45
Removed "me"
|
| + // last keystroke if there was an asynchronous provider that returned |
| + // and changed the default match. See UpdateResult() for details on |
| + // when we consider a match has changed. |
|
Peter Kasting
2012/11/16 23:57:18
Nit: has -> to have
Mark P
2012/11/19 22:21:45
Done.
|
| + base::TimeTicks last_time_default_match_changed_; |
| + |
| // Timer used to remove any matches copied from the last result. When run |
| // invokes |ExpireCopiedEntries|. |
| base::OneShotTimer<AutocompleteController> expire_timer_; |