| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/search_engines/search_terms_data.h" | 5 #include "chrome/browser/search_engines/search_terms_data.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/google/google_url_tracker.h" | 10 #include "chrome/browser/google/google_url_tracker.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 std::string SearchTermsData::GoogleBaseSuggestURLValue() const { | 28 std::string SearchTermsData::GoogleBaseSuggestURLValue() const { |
| 29 // Start with the Google base URL. | 29 // Start with the Google base URL. |
| 30 const GURL base_url(GoogleBaseURLValue()); | 30 const GURL base_url(GoogleBaseURLValue()); |
| 31 DCHECK(base_url.is_valid()); | 31 DCHECK(base_url.is_valid()); |
| 32 | 32 |
| 33 GURL::Replacements repl; | 33 GURL::Replacements repl; |
| 34 | 34 |
| 35 // Replace any existing path with "/complete/". | 35 // Replace any existing path with "/complete/". |
| 36 repl.SetPathStr("/complete/"); | 36 static const std::string suggest_path("/complete/"); |
| 37 repl.SetPathStr(suggest_path); |
| 37 | 38 |
| 38 // Clear the query and ref. | 39 // Clear the query and ref. |
| 39 repl.ClearQuery(); | 40 repl.ClearQuery(); |
| 40 repl.ClearRef(); | 41 repl.ClearRef(); |
| 41 return base_url.ReplaceComponents(repl).spec(); | 42 return base_url.ReplaceComponents(repl).spec(); |
| 42 } | 43 } |
| 43 | 44 |
| 44 std::string SearchTermsData::InstantFieldTrialUrlParam() const { | 45 std::string SearchTermsData::InstantFieldTrialUrlParam() const { |
| 45 return std::string(); | 46 return std::string(); |
| 46 } | 47 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || | 92 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || |
| 92 BrowserThread::CurrentlyOn(BrowserThread::UI)); | 93 BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 93 return InstantFieldTrial::GetGroupAsUrlParam(profile_); | 94 return InstantFieldTrial::GetGroupAsUrlParam(profile_); |
| 94 } | 95 } |
| 95 | 96 |
| 96 // static | 97 // static |
| 97 void UIThreadSearchTermsData::SetGoogleBaseURL(std::string* google_base_url) { | 98 void UIThreadSearchTermsData::SetGoogleBaseURL(std::string* google_base_url) { |
| 98 delete google_base_url_; | 99 delete google_base_url_; |
| 99 google_base_url_ = google_base_url; | 100 google_base_url_ = google_base_url; |
| 100 } | 101 } |
| OLD | NEW |