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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 bool ParseSuggestResults(base::Value* root_val, bool is_keyword); | 372 bool ParseSuggestResults(base::Value* root_val, bool is_keyword); |
373 | 373 |
374 // Converts the parsed results to a set of AutocompleteMatches, |matches_|. | 374 // Converts the parsed results to a set of AutocompleteMatches, |matches_|. |
375 void ConvertResultsToAutocompleteMatches(); | 375 void ConvertResultsToAutocompleteMatches(); |
376 | 376 |
377 // Checks if suggested relevances violate certain expected constraints. | 377 // Checks if suggested relevances violate certain expected constraints. |
378 // See UpdateMatches() for the use and explanation of these constraints. | 378 // See UpdateMatches() for the use and explanation of these constraints. |
379 bool IsTopMatchNavigationInKeywordMode() const; | 379 bool IsTopMatchNavigationInKeywordMode() const; |
380 bool IsTopMatchScoreTooLow() const; | 380 bool IsTopMatchScoreTooLow() const; |
381 bool IsTopMatchSearchWithURLInput() const; | 381 bool IsTopMatchSearchWithURLInput() const; |
382 bool IsTopMatchNotInlinable() const; | 382 bool IsTopMatchNotAllowedToBeDefaultMatch() const; |
| 383 bool LacksDefaultMatch() const; |
383 | 384 |
384 // Updates |matches_| from the latest results; applies calculated relevances | 385 // Updates |matches_| from the latest results; applies calculated relevances |
385 // if suggested relevances cause undesriable behavior. Updates |done_|. | 386 // if suggested relevances cause undesriable behavior. Updates |done_|. |
386 void UpdateMatches(); | 387 void UpdateMatches(); |
387 | 388 |
388 // Converts an appropriate number of navigation results in | 389 // Converts an appropriate number of navigation results in |
389 // |navigation_results| to matches and adds them to |matches|. | 390 // |navigation_results| to matches and adds them to |matches|. |
390 void AddNavigationResultsToMatches( | 391 void AddNavigationResultsToMatches( |
391 const NavigationResults& navigation_results, | 392 const NavigationResults& navigation_results, |
392 ACMatches* matches); | 393 ACMatches* matches); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 // Start margin of the omnibox. Used to construct search URLs. | 528 // Start margin of the omnibox. Used to construct search URLs. |
528 int omnibox_start_margin_; | 529 int omnibox_start_margin_; |
529 | 530 |
530 // If true, search history query suggestions will score low enough that | 531 // If true, search history query suggestions will score low enough that |
531 // they will not be inlined. | 532 // they will not be inlined. |
532 bool prevent_search_history_inlining_; | 533 bool prevent_search_history_inlining_; |
533 | 534 |
534 // If true, no search history query suggestions will be offered. | 535 // If true, no search history query suggestions will be offered. |
535 bool disable_search_history_; | 536 bool disable_search_history_; |
536 | 537 |
| 538 // True if the omnibox will reorder matches as necessary to make the top |
| 539 // one something that is allowed to be the default match. |
| 540 bool omnibox_will_reorder_for_legal_default_match_; |
| 541 |
537 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 542 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
538 }; | 543 }; |
539 | 544 |
540 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 545 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
OLD | NEW |