| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 bool ParseSuggestResults(base::Value* root_val, bool is_keyword); | 369 bool ParseSuggestResults(base::Value* root_val, bool is_keyword); |
| 370 | 370 |
| 371 // Converts the parsed results to a set of AutocompleteMatches, |matches_|. | 371 // Converts the parsed results to a set of AutocompleteMatches, |matches_|. |
| 372 void ConvertResultsToAutocompleteMatches(); | 372 void ConvertResultsToAutocompleteMatches(); |
| 373 | 373 |
| 374 // Checks if suggested relevances violate certain expected constraints. | 374 // Checks if suggested relevances violate certain expected constraints. |
| 375 // See UpdateMatches() for the use and explanation of these constraints. | 375 // See UpdateMatches() for the use and explanation of these constraints. |
| 376 bool IsTopMatchNavigationInKeywordMode() const; | 376 bool IsTopMatchNavigationInKeywordMode() const; |
| 377 bool IsTopMatchScoreTooLow() const; | 377 bool IsTopMatchScoreTooLow() const; |
| 378 bool IsTopMatchSearchWithURLInput() const; | 378 bool IsTopMatchSearchWithURLInput() const; |
| 379 bool IsTopMatchNotInlinable() const; | 379 bool HasValidDefaultMatch( |
| 380 bool autocomplete_result_will_reorder_for_default_match) const; |
| 380 | 381 |
| 381 // Updates |matches_| from the latest results; applies calculated relevances | 382 // Updates |matches_| from the latest results; applies calculated relevances |
| 382 // if suggested relevances cause undesriable behavior. Updates |done_|. | 383 // if suggested relevances cause undesriable behavior. Updates |done_|. |
| 383 void UpdateMatches(); | 384 void UpdateMatches(); |
| 384 | 385 |
| 385 // Converts an appropriate number of navigation results in | 386 // Converts an appropriate number of navigation results in |
| 386 // |navigation_results| to matches and adds them to |matches|. | 387 // |navigation_results| to matches and adds them to |matches|. |
| 387 void AddNavigationResultsToMatches( | 388 void AddNavigationResultsToMatches( |
| 388 const NavigationResults& navigation_results, | 389 const NavigationResults& navigation_results, |
| 389 ACMatches* matches); | 390 ACMatches* matches); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 bool field_trial_triggered_in_session_; | 526 bool field_trial_triggered_in_session_; |
| 526 | 527 |
| 527 // If true, search history query suggestions will score low enough that | 528 // If true, search history query suggestions will score low enough that |
| 528 // they will not be inlined. | 529 // they will not be inlined. |
| 529 bool prevent_search_history_inlining_; | 530 bool prevent_search_history_inlining_; |
| 530 | 531 |
| 531 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 532 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 532 }; | 533 }; |
| 533 | 534 |
| 534 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 535 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| OLD | NEW |