OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "ios/chrome/browser/search_engines/ui_thread_search_terms_data.h" | 5 #include "ios/chrome/browser/search_engines/ui_thread_search_terms_data.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "components/google/core/browser/google_url_tracker.h" | 9 #include "components/google/core/browser/google_url_tracker.h" |
10 #include "components/google/core/browser/google_util.h" | 10 #include "components/google/core/browser/google_util.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 return rlz_string; | 74 return rlz_string; |
75 } | 75 } |
76 | 76 |
77 std::string UIThreadSearchTermsData::GetSearchClient() const { | 77 std::string UIThreadSearchTermsData::GetSearchClient() const { |
78 DCHECK(thread_checker_.CalledOnValidThread()); | 78 DCHECK(thread_checker_.CalledOnValidThread()); |
79 return std::string(); | 79 return std::string(); |
80 } | 80 } |
81 | 81 |
82 std::string UIThreadSearchTermsData::GetSuggestClient() const { | 82 std::string UIThreadSearchTermsData::GetSuggestClient() const { |
83 DCHECK(thread_checker_.CalledOnValidThread()); | 83 DCHECK(thread_checker_.CalledOnValidThread()); |
84 return chrome::IsInstantExtendedAPIEnabled() ? "chrome-omni" : "chrome"; | 84 return search::IsInstantExtendedAPIEnabled() ? "chrome-omni" : "chrome"; |
85 } | 85 } |
86 | 86 |
87 std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { | 87 std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { |
88 DCHECK(thread_checker_.CalledOnValidThread()); | 88 DCHECK(thread_checker_.CalledOnValidThread()); |
89 return "chrome-ext-ansg"; | 89 return "chrome-ext-ansg"; |
90 } | 90 } |
91 | 91 |
92 bool UIThreadSearchTermsData::IsShowingSearchTermsOnSearchResultsPages() const { | 92 bool UIThreadSearchTermsData::IsShowingSearchTermsOnSearchResultsPages() const { |
93 DCHECK(thread_checker_.CalledOnValidThread()); | 93 DCHECK(thread_checker_.CalledOnValidThread()); |
94 return chrome::IsInstantExtendedAPIEnabled() && | 94 return search::IsInstantExtendedAPIEnabled() && |
95 ios::GetChromeBrowserProvider() | 95 search::IsQueryExtractionEnabled(); |
96 ->GetSearchProvider() | |
97 ->IsQueryExtractionEnabled(); | |
98 } | 96 } |
99 | 97 |
100 std::string UIThreadSearchTermsData::InstantExtendedEnabledParam( | 98 std::string UIThreadSearchTermsData::InstantExtendedEnabledParam( |
101 bool for_search) const { | 99 bool for_search) const { |
102 DCHECK(thread_checker_.CalledOnValidThread()); | 100 DCHECK(thread_checker_.CalledOnValidThread()); |
103 return ios::GetChromeBrowserProvider() | 101 return search::InstantExtendedEnabledParam(for_search); |
104 ->GetSearchProvider() | |
105 ->InstantExtendedEnabledParam(for_search); | |
106 } | 102 } |
107 | 103 |
108 std::string UIThreadSearchTermsData::ForceInstantResultsParam( | 104 std::string UIThreadSearchTermsData::ForceInstantResultsParam( |
109 bool for_prerender) const { | 105 bool for_prerender) const { |
110 DCHECK(thread_checker_.CalledOnValidThread()); | 106 DCHECK(thread_checker_.CalledOnValidThread()); |
111 return ios::GetChromeBrowserProvider() | 107 return search::ForceInstantResultsParam(for_prerender); |
112 ->GetSearchProvider() | |
113 ->ForceInstantResultsParam(for_prerender); | |
114 } | 108 } |
115 | 109 |
116 int UIThreadSearchTermsData::OmniboxStartMargin() const { | 110 int UIThreadSearchTermsData::OmniboxStartMargin() const { |
117 DCHECK(thread_checker_.CalledOnValidThread()); | 111 DCHECK(thread_checker_.CalledOnValidThread()); |
118 return ios::GetChromeBrowserProvider() | 112 // iOS has not InstantService. |
119 ->GetSearchProvider() | 113 return search::kDisableStartMargin; |
120 ->OmniboxStartMargin(); | |
121 } | 114 } |
122 | 115 |
123 std::string UIThreadSearchTermsData::NTPIsThemedParam() const { | 116 std::string UIThreadSearchTermsData::NTPIsThemedParam() const { |
124 DCHECK(thread_checker_.CalledOnValidThread()); | 117 DCHECK(thread_checker_.CalledOnValidThread()); |
| 118 // iOS does not supports themed NTP. |
125 return std::string(); | 119 return std::string(); |
126 } | 120 } |
127 | 121 |
128 std::string UIThreadSearchTermsData::GoogleImageSearchSource() const { | 122 std::string UIThreadSearchTermsData::GoogleImageSearchSource() const { |
129 DCHECK(thread_checker_.CalledOnValidThread()); | 123 DCHECK(thread_checker_.CalledOnValidThread()); |
130 return ios::GetChromeBrowserProvider() | 124 return ios::GetChromeBrowserProvider() |
131 ->GetSearchProvider() | 125 ->GetSearchProvider() |
132 ->GoogleImageSearchSource(); | 126 ->GoogleImageSearchSource(); |
133 } | 127 } |
134 | 128 |
135 } // namespace ios | 129 } // namespace ios |
OLD | NEW |