Home | History | Annotate | Download | only in search_engines
      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_engines/search_terms_data.h"
      6 
      7 #include "base/logging.h"
      8 #include "components/google/core/browser/google_url_tracker.h"
      9 #include "url/gurl.h"
     10 
     11 SearchTermsData::SearchTermsData() {
     12 }
     13 
     14 SearchTermsData::~SearchTermsData() {
     15 }
     16 
     17 std::string SearchTermsData::GoogleBaseURLValue() const {
     18   return GoogleURLTracker::kDefaultGoogleHomepage;
     19 }
     20 
     21 std::string SearchTermsData::GoogleBaseSuggestURLValue() const {
     22   // Start with the Google base URL.
     23   const GURL base_url(GoogleBaseURLValue());
     24   DCHECK(base_url.is_valid());
     25 
     26   GURL::Replacements repl;
     27 
     28   // Replace any existing path with "/complete/".
     29   // SetPathStr() requires its argument to stay in scope as long as |repl| is,
     30   // so "/complete/" can't be passed to SetPathStr() directly, it needs to be in
     31   // a variable.
     32   const std::string suggest_path("/complete/");
     33   repl.SetPathStr(suggest_path);
     34 
     35   // Clear the query and ref.
     36   repl.ClearQuery();
     37   repl.ClearRef();
     38   return base_url.ReplaceComponents(repl).spec();
     39 }
     40 
     41 std::string SearchTermsData::GetApplicationLocale() const {
     42   return "en";
     43 }
     44 
     45 base::string16 SearchTermsData::GetRlzParameterValue(bool from_app_list) const {
     46   return base::string16();
     47 }
     48 
     49 std::string SearchTermsData::GetSearchClient() const {
     50   return std::string();
     51 }
     52 
     53 std::string SearchTermsData::GetSuggestClient() const {
     54   return std::string();
     55 }
     56 
     57 std::string SearchTermsData::GetSuggestRequestIdentifier() const {
     58   return std::string();
     59 }
     60 
     61 bool SearchTermsData::EnableAnswersInSuggest() const {
     62   return false;
     63 }
     64 
     65 bool SearchTermsData::IsShowingSearchTermsOnSearchResultsPages() const {
     66   return false;
     67 }
     68 
     69 std::string SearchTermsData::InstantExtendedEnabledParam(
     70     bool for_search) const {
     71   return std::string();
     72 }
     73 
     74 std::string SearchTermsData::ForceInstantResultsParam(
     75     bool for_prerender) const {
     76   return std::string();
     77 }
     78 
     79 int SearchTermsData::OmniboxStartMargin() const {
     80   return 0;
     81 }
     82 
     83 std::string SearchTermsData::NTPIsThemedParam() const {
     84   return std::string();
     85 }
     86 
     87 std::string SearchTermsData::GoogleImageSearchSource() const {
     88   return std::string();
     89 }
     90