1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "components/search/search.h" 6 7 #include "build/build_config.h" 8 #include "components/search_engines/search_engine_type.h" 9 #include "components/search_engines/search_terms_data.h" 10 #include "components/search_engines/template_url.h" 11 #include "components/search_engines/template_url_service.h" 12 13 namespace search { 14 IsInstantExtendedAPIEnabled()15bool IsInstantExtendedAPIEnabled() { 16 #if defined(OS_IOS) || defined(OS_ANDROID) 17 return false; 18 #else 19 return true; 20 #endif 21 } 22 DefaultSearchProviderIsGoogle(const TemplateURLService * template_url_service)23bool DefaultSearchProviderIsGoogle( 24 const TemplateURLService* template_url_service) { 25 if (!template_url_service) 26 return false; 27 const TemplateURL* default_provider = 28 template_url_service->GetDefaultSearchProvider(); 29 if (!default_provider) 30 return false; 31 return default_provider->GetEngineType( 32 template_url_service->search_terms_data()) == 33 SearchEngineType::SEARCH_ENGINE_GOOGLE; 34 } 35 36 } // namespace search 37