| Index: chrome/browser/ui/app_list/search/webstore/webstore_provider.cc
|
| diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc
|
| index b22b397bc19f959794e1c065d559c0312879d735..a831ca84646437676b69c6350c5174882e3e3acc 100644
|
| --- a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc
|
| +++ b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc
|
| @@ -18,6 +18,8 @@
|
| #include "chrome/browser/ui/app_list/search/search_webstore_result.h"
|
| #include "chrome/browser/ui/app_list/search/webstore/webstore_result.h"
|
| #include "chrome/common/extensions/extension_constants.h"
|
| +#include "extensions/common/extension_urls.h"
|
| +#include "net/base/url_util.h"
|
| #include "url/gurl.h"
|
|
|
| namespace app_list {
|
| @@ -36,6 +38,19 @@ bool UseWebstoreSearch() {
|
| return base::FieldTrialList::FindFullName(kFieldTrialName) == kEnable;
|
| }
|
|
|
| +// Returns the URL used to get webstore search results in JSON format. The URL
|
| +// returns a JSON dictionary that has the search results (under "results").
|
| +// Each entry in the array is a dictionary with data for an extension.
|
| +// |query| is the user typed query string. |hl| is the host language code,
|
| +// e.g. en_US. Both arguments will be escaped and added as a query parameter
|
| +// to the returned web store json search URL.
|
| +GURL GetWebstoreJsonSearchURL(const std::string& query, const std::string& hl) {
|
| + GURL url(extensions::GetWebstoreLaunchURL() + "/jsonsearch");
|
| + url = net::AppendQueryParameter(url, "q", query);
|
| + url = net::AppendQueryParameter(url, "hl", hl);
|
| + return url;
|
| +}
|
| +
|
| } // namespace
|
|
|
| WebstoreProvider::WebstoreProvider(Profile* profile,
|
| @@ -90,7 +105,7 @@ void WebstoreProvider::StartQuery() {
|
| if (!webstore_search_ || query_.empty())
|
| return;
|
|
|
| - webstore_search_->Start(extension_urls::GetWebstoreJsonSearchUrl(
|
| + webstore_search_->Start(GetWebstoreJsonSearchURL(
|
| query_, g_browser_process->GetApplicationLocale()));
|
| }
|
|
|
|
|