OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2012 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 "chrome/browser/search_engines/search_terms_data_android.h" | |
6 | |
7 #include "chrome/browser/search_engines/search_terms_data.h" | |
8 #include "content/public/browser/browser_thread.h" | |
9 | |
10 using content::BrowserThread; | |
Peter Kasting
2012/12/06 07:02:37
Nit: Don't use using directives unless they save a
gone
2012/12/06 20:59:49
Done.
| |
11 | |
12 base::LazyInstance<string16>::Leaky | |
13 SearchTermsDataAndroid::rlz_parameter_value_ = LAZY_INSTANCE_INITIALIZER; | |
14 base::LazyInstance<std::string>::Leaky | |
15 SearchTermsDataAndroid::search_client_ = LAZY_INSTANCE_INITIALIZER; | |
16 | |
17 string16 SearchTermsDataAndroid::GetRlzParameterValue() { | |
18 return rlz_parameter_value_.Get(); | |
19 } | |
20 | |
21 void SearchTermsDataAndroid::SetRlzParameterValue(const string16& rlz) { | |
22 rlz_parameter_value_.Get() = rlz; | |
23 } | |
24 | |
25 std::string SearchTermsDataAndroid::GetSearchClient() { | |
26 return search_client_.Get(); | |
27 } | |
28 | |
29 void SearchTermsDataAndroid::SetSearchClient(const std::string& client) { | |
30 search_client_.Get() = client; | |
31 } | |
32 | |
33 string16 UIThreadSearchTermsData::GetRlzParameterValue() const { | |
34 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || | |
35 BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
Peter Kasting
2012/12/06 07:02:37
Nit: Indent 4, not even (2 places)
gone
2012/12/06 20:59:49
Funky. I copied these directly from search_terms_
| |
36 // Android doesn't use the rlz library. Instead, it manages the rlz string | |
37 // on its own. | |
38 return SearchTermsDataAndroid::GetRlzParameterValue(); | |
Peter Kasting
2012/12/06 07:02:37
I suggest returning the value directly here and be
gone
2012/12/06 20:59:49
Kept them inside an otherwise empty struct to keep
| |
39 } | |
40 | |
41 std::string UIThreadSearchTermsData::GetSearchClient() const { | |
42 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || | |
43 BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
44 return SearchTermsDataAndroid::GetSearchClient(); | |
45 } | |
OLD | NEW |