diff options
author | sdefresne <sdefresne@chromium.org> | 2015-08-03 07:18:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-03 14:18:41 +0000 |
commit | 51bbec7be7014d4d75d39c1a5c27b1ba9ddc3dcd (patch) | |
tree | 912625ef3699b6c080aa3cca3340966298130333 /components/omnibox/browser | |
parent | e52e8da071b5d27eead353a38ddbc822af9ef0fc (diff) | |
download | chromium_src-51bbec7be7014d4d75d39c1a5c27b1ba9ddc3dcd.zip chromium_src-51bbec7be7014d4d75d39c1a5c27b1ba9ddc3dcd.tar.gz chromium_src-51bbec7be7014d4d75d39c1a5c27b1ba9ddc3dcd.tar.bz2 |
Partially componentize //chrome/browser/search/search.{h,cc}
Move functions from //chrome/browser/search/search.{h,cc} to the search
component //components/search/search.{h,cc} so that they can be shared
with iOS.
Move all the code in those two files (and supporting unittests) from
the "chrome" to the "search" namespace.
Move unittests that do not depends on non-componentized functions into
the search component.
Implements GetSearchTerms() on iOS that uses a web::WebState* instead
of content::WebContents and simplify the code to remove unsupported
features.
Directly use //components/search on iOS instead of the SearchProvider
when possible.
BUG=514239
TBR=sky,droger,benwells
Review URL: https://codereview.chromium.org/1260033003
Cr-Commit-Position: refs/heads/master@{#341525}
Diffstat (limited to 'components/omnibox/browser')
-rw-r--r-- | components/omnibox/browser/omnibox_field_trial.cc | 2 | ||||
-rw-r--r-- | components/omnibox/browser/omnibox_field_trial_unittest.cc | 2 | ||||
-rw-r--r-- | components/omnibox/browser/search_provider.cc | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc index 9bda3e2..7552795 100644 --- a/components/omnibox/browser/omnibox_field_trial.cc +++ b/components/omnibox/browser/omnibox_field_trial.cc @@ -497,7 +497,7 @@ std::string OmniboxFieldTrial::GetValueForRuleInContext( const std::string page_classification_str = base::IntToString(static_cast<int>(page_classification)); const std::string instant_extended = - chrome::IsInstantExtendedAPIEnabled() ? "1" : "0"; + search::IsInstantExtendedAPIEnabled() ? "1" : "0"; // Look up rule in this exact context. VariationParams::const_iterator it = params.find( rule + ":" + page_classification_str + ":" + instant_extended); diff --git a/components/omnibox/browser/omnibox_field_trial_unittest.cc b/components/omnibox/browser/omnibox_field_trial_unittest.cc index 0ed85a7..a7fc148 100644 --- a/components/omnibox/browser/omnibox_field_trial_unittest.cc +++ b/components/omnibox/browser/omnibox_field_trial_unittest.cc @@ -318,7 +318,7 @@ TEST_F(OmniboxFieldTrialTest, GetValueForRuleInContext) { base::FieldTrialList::CreateFieldTrial( OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A"); - if (chrome::IsInstantExtendedAPIEnabled()) { + if (search::IsInstantExtendedAPIEnabled()) { // Tests with Instant Extended enabled. // Tests for rule 1. ExpectRuleValue("rule1-4-1-value", diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc index 6272c2f..9067f859 100644 --- a/components/omnibox/browser/search_provider.cc +++ b/components/omnibox/browser/search_provider.cc @@ -1003,7 +1003,7 @@ void SearchProvider::ConvertResultsToAutocompleteMatches() { // If we've already hit the limit on non-server-scored suggestions, and // this isn't a server-scored suggestion we can add, skip it. if ((num_suggestions >= kMaxMatches) && - (!chrome::IsInstantExtendedAPIEnabled() || + (!search::IsInstantExtendedAPIEnabled() || (i->GetAdditionalInfo(kRelevanceFromServerKey) != kTrue))) { continue; } |