| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/threading/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
| 11 #include "chrome/browser/google/google_url_tracker.h" | 11 #include "chrome/browser/google/google_url_tracker.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 (*google_base_url_) : GoogleURLTracker::GoogleURL().spec(); | 66 (*google_base_url_) : GoogleURLTracker::GoogleURL().spec(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 std::string UIThreadSearchTermsData::GetApplicationLocale() const { | 69 std::string UIThreadSearchTermsData::GetApplicationLocale() const { |
| 70 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || | 70 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || |
| 71 BrowserThread::CurrentlyOn(BrowserThread::UI)); | 71 BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 72 return g_browser_process->GetApplicationLocale(); | 72 return g_browser_process->GetApplicationLocale(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 75 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) |
| 76 string16 UIThreadSearchTermsData::GetRlzParameterValue() const { | 76 std::wstring UIThreadSearchTermsData::GetRlzParameterValue() const { |
| 77 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || | 77 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || |
| 78 BrowserThread::CurrentlyOn(BrowserThread::UI)); | 78 BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 79 string16 rlz_string; | 79 std::wstring rlz_string; |
| 80 // For organic brandcodes do not use rlz at all. Empty brandcode usually | 80 // For organic brandcodes do not use rlz at all. Empty brandcode usually |
| 81 // means a chromium install. This is ok. | 81 // means a chromium install. This is ok. |
| 82 string16 brand; | 82 std::wstring brand; |
| 83 // See http://crbug.com/62337 . | 83 // See http://crbug.com/62337. |
| 84 base::ThreadRestrictions::ScopedAllowIO allow_io; | 84 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 85 if (GoogleUpdateSettings::GetBrand(&brand) && !brand.empty() && | 85 if (GoogleUpdateSettings::GetBrand(&brand) && !brand.empty() && |
| 86 !GoogleUpdateSettings::IsOrganic(brand)) | 86 !GoogleUpdateSettings::IsOrganic(brand)) |
| 87 RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz_string); | 87 RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz_string); |
| 88 return rlz_string; | 88 return rlz_string; |
| 89 } | 89 } |
| 90 #endif | 90 #endif |
| 91 | 91 |
| 92 // static | 92 // static |
| 93 void UIThreadSearchTermsData::SetGoogleBaseURL(std::string* google_base_url) { | 93 void UIThreadSearchTermsData::SetGoogleBaseURL(std::string* google_base_url) { |
| 94 delete google_base_url_; | 94 delete google_base_url_; |
| 95 google_base_url_ = google_base_url; | 95 google_base_url_ = google_base_url; |
| 96 } | 96 } |
| OLD | NEW |