OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/android/provider/chrome_browser_provider.h" | 5 #include "chrome/browser/android/provider/chrome_browser_provider.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 887 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
888 | 888 |
889 TemplateURLService* template_service = | 889 TemplateURLService* template_service = |
890 TemplateURLServiceFactory::GetForProfile(profile_); | 890 TemplateURLServiceFactory::GetForProfile(profile_); |
891 template_service->Load(); | 891 template_service->Load(); |
892 | 892 |
893 const TemplateURL* search_engine = | 893 const TemplateURL* search_engine = |
894 template_service->GetDefaultSearchProvider(); | 894 template_service->GetDefaultSearchProvider(); |
895 if (search_engine) { | 895 if (search_engine) { |
896 const TemplateURLRef* search_url = &search_engine->url_ref(); | 896 const TemplateURLRef* search_url = &search_engine->url_ref(); |
897 std::string url = search_url->ReplaceSearchTerms( | 897 TemplateURLRef::SearchTermsArgs search_terms_args(row->search_term()); |
898 TemplateURLRef::SearchTermsArgs(row->search_term())); | 898 search_terms_args.append_extra_query_params = true; |
| 899 std::string url = search_url->ReplaceSearchTerms(search_terms_args); |
899 if (!url.empty()) { | 900 if (!url.empty()) { |
900 row->set_url(GURL(url)); | 901 row->set_url(GURL(url)); |
901 row->set_template_url_id(search_engine->id()); | 902 row->set_template_url_id(search_engine->id()); |
902 } | 903 } |
903 } | 904 } |
904 } | 905 } |
905 | 906 |
906 private: | 907 private: |
907 Profile* profile_; | 908 Profile* profile_; |
908 | 909 |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1603 chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED) { | 1604 chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED) { |
1604 JNIEnv* env = AttachCurrentThread(); | 1605 JNIEnv* env = AttachCurrentThread(); |
1605 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); | 1606 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); |
1606 if (obj.is_null()) | 1607 if (obj.is_null()) |
1607 return; | 1608 return; |
1608 Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj()); | 1609 Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj()); |
1609 } else if (type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED) { | 1610 } else if (type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED) { |
1610 template_loaded_event_.Signal(); | 1611 template_loaded_event_.Signal(); |
1611 } | 1612 } |
1612 } | 1613 } |
OLD | NEW |