OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file contains the Search autocomplete provider. This provider is | 5 // This file contains the Search autocomplete provider. This provider is |
6 // responsible for all autocomplete entries that start with "Search <engine> | 6 // responsible for all autocomplete entries that start with "Search <engine> |
7 // for ...", including searching for the current input string, search | 7 // for ...", including searching for the current input string, search |
8 // history, and search suggestions. An instance of it gets created and | 8 // history, and search suggestions. An instance of it gets created and |
9 // managed by the autocomplete controller. | 9 // managed by the autocomplete controller. |
10 | 10 |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // |autocomplete_result_will_reorder_for_default_match| is false, | 423 // |autocomplete_result_will_reorder_for_default_match| is false, |
424 // this simply means the first match; otherwise, it means the first | 424 // this simply means the first match; otherwise, it means the first |
425 // match for which the |allowed_to_be_default_match| member is true. | 425 // match for which the |allowed_to_be_default_match| member is true. |
426 ACMatches::const_iterator FindTopMatch( | 426 ACMatches::const_iterator FindTopMatch( |
427 bool autocomplete_result_will_reorder_for_default_match) const; | 427 bool autocomplete_result_will_reorder_for_default_match) const; |
428 | 428 |
429 // Checks if suggested relevances violate certain expected constraints. | 429 // Checks if suggested relevances violate certain expected constraints. |
430 // See UpdateMatches() for the use and explanation of these constraints. | 430 // See UpdateMatches() for the use and explanation of these constraints. |
431 bool IsTopMatchNavigationInKeywordMode( | 431 bool IsTopMatchNavigationInKeywordMode( |
432 bool autocomplete_result_will_reorder_for_default_match) const; | 432 bool autocomplete_result_will_reorder_for_default_match) const; |
| 433 bool HasKeywordDefaultMatchInKeywordMode() const; |
433 bool IsTopMatchScoreTooLow( | 434 bool IsTopMatchScoreTooLow( |
434 bool autocomplete_result_will_reorder_for_default_match) const; | 435 bool autocomplete_result_will_reorder_for_default_match) const; |
435 bool IsTopMatchSearchWithURLInput( | 436 bool IsTopMatchSearchWithURLInput( |
436 bool autocomplete_result_will_reorder_for_default_match) const; | 437 bool autocomplete_result_will_reorder_for_default_match) const; |
437 bool HasValidDefaultMatch( | 438 bool HasValidDefaultMatch( |
438 bool autocomplete_result_will_reorder_for_default_match) const; | 439 bool autocomplete_result_will_reorder_for_default_match) const; |
439 | 440 |
440 // Updates |matches_| from the latest results; applies calculated relevances | 441 // Updates |matches_| from the latest results; applies calculated relevances |
441 // if suggested relevances cause undesriable behavior. Updates |done_|. | 442 // if suggested relevances cause undesriable behavior. Updates |done_|. |
442 void UpdateMatches(); | 443 void UpdateMatches(); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 // If true, search history query suggestions will score low enough that | 633 // If true, search history query suggestions will score low enough that |
633 // they will not be inlined. | 634 // they will not be inlined. |
634 bool prevent_search_history_inlining_; | 635 bool prevent_search_history_inlining_; |
635 | 636 |
636 GURL current_page_url_; | 637 GURL current_page_url_; |
637 | 638 |
638 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 639 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
639 }; | 640 }; |
640 | 641 |
641 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 642 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
OLD | NEW |