OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/ui_thread_search_terms_data_android.h" | 5 #include "chrome/browser/search_engines/ui_thread_search_terms_data_android.h" |
6 | 6 |
| 7 #include "chrome/browser/android/locale/locale_manager.h" |
7 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" | 8 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
8 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
9 | 10 |
10 base::LazyInstance<base::string16>::Leaky | 11 base::LazyInstance<base::string16>::Leaky |
11 SearchTermsDataAndroid::rlz_parameter_value_ = LAZY_INSTANCE_INITIALIZER; | 12 SearchTermsDataAndroid::rlz_parameter_value_ = LAZY_INSTANCE_INITIALIZER; |
12 base::LazyInstance<std::string>::Leaky | 13 base::LazyInstance<std::string>::Leaky |
13 SearchTermsDataAndroid::search_client_ = LAZY_INSTANCE_INITIALIZER; | 14 SearchTermsDataAndroid::search_client_ = LAZY_INSTANCE_INITIALIZER; |
14 | 15 |
15 base::string16 UIThreadSearchTermsData::GetRlzParameterValue( | 16 base::string16 UIThreadSearchTermsData::GetRlzParameterValue( |
16 bool from_app_list) const { | 17 bool from_app_list) const { |
17 DCHECK(!content::BrowserThread::IsThreadInitialized( | 18 DCHECK(!content::BrowserThread::IsThreadInitialized( |
18 content::BrowserThread::UI) || | 19 content::BrowserThread::UI) || |
19 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 20 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
20 // Android doesn't use the rlz library. Instead, it manages the rlz string | 21 // Android doesn't use the rlz library. Instead, it manages the rlz string |
21 // on its own. | 22 // on its own. |
22 return SearchTermsDataAndroid::rlz_parameter_value_.Get(); | 23 return SearchTermsDataAndroid::rlz_parameter_value_.Get(); |
23 } | 24 } |
24 | 25 |
25 std::string UIThreadSearchTermsData::GetSearchClient() const { | 26 std::string UIThreadSearchTermsData::GetSearchClient() const { |
26 DCHECK(!content::BrowserThread::IsThreadInitialized( | 27 DCHECK(!content::BrowserThread::IsThreadInitialized( |
27 content::BrowserThread::UI) || | 28 content::BrowserThread::UI) || |
28 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 29 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
29 return SearchTermsDataAndroid::search_client_.Get(); | 30 return SearchTermsDataAndroid::search_client_.Get(); |
30 } | 31 } |
| 32 |
| 33 std::string UIThreadSearchTermsData::GetYandexReferralID() const { |
| 34 return LocaleManager::GetYandexReferralID(); |
| 35 } |
OLD | NEW |