Index: chrome/browser/ui/app_list/search/common/json_response_fetcher.h |
diff --git a/chrome/browser/ui/app_list/search/webstore_search_fetcher.h b/chrome/browser/ui/app_list/search/common/json_response_fetcher.h |
similarity index 59% |
rename from chrome/browser/ui/app_list/search/webstore_search_fetcher.h |
rename to chrome/browser/ui/app_list/search/common/json_response_fetcher.h |
index 442c196ca18a65af07b2fea4a1460722d6988455..04b9fdfb86eea0f647ec692f4c329d19c8cf033f 100644 |
--- a/chrome/browser/ui/app_list/search/webstore_search_fetcher.h |
+++ b/chrome/browser/ui/app_list/search/common/json_response_fetcher.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_WEBSTORE_SEARCH_FETCHER_H_ |
-#define CHROME_BROWSER_UI_APP_LIST_SEARCH_WEBSTORE_SEARCH_FETCHER_H_ |
+#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_JSON_RESPONSE_FETCHER_H_ |
+#define CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_JSON_RESPONSE_FETCHER_H_ |
#include <string> |
@@ -13,6 +13,8 @@ |
#include "base/memory/weak_ptr.h" |
#include "net/url_request/url_fetcher_delegate.h" |
+class GURL; |
+ |
namespace base { |
class DictionaryValue; |
class Value; |
@@ -25,19 +27,20 @@ class URLRequestContextGetter; |
namespace app_list { |
-// A class to fetch web store search result. |
-class WebstoreSearchFetcher : public net::URLFetcherDelegate { |
+// A class that fetches a JSON formatted response from a server and uses a |
+// sandboxed utility process to parse it to a DictionaryValue. |
+class JSONResponseFetcher : public net::URLFetcherDelegate { |
tfarina
2013/09/04 23:49:52
this probably can be used by WalletClient (compone
rkc
2013/09/04 23:57:30
Wallet client's processing in OnURLFetchComplete i
tfarina
2013/09/04 23:59:05
sure, I was not suggesting you to try to make any
|
public: |
// Callback to pass back the parsed json dictionary returned from the server. |
// Invoked with NULL if there is an error. |
typedef base::Callback<void(scoped_ptr<base::DictionaryValue>)> Callback; |
- WebstoreSearchFetcher(const Callback& callback, |
- net::URLRequestContextGetter* context_getter); |
- virtual ~WebstoreSearchFetcher(); |
+ JSONResponseFetcher(const Callback& callback, |
+ net::URLRequestContextGetter* context_getter); |
+ virtual ~JSONResponseFetcher(); |
- // Starts to fetch results for the given |query| and the language code |hl|. |
- void Start(const std::string& query, const std::string& hl); |
+ // Starts to fetch results for the given |query_url|. |
+ void Start(const GURL& query_url); |
void Stop(); |
private: |
@@ -52,11 +55,11 @@ class WebstoreSearchFetcher : public net::URLFetcherDelegate { |
net::URLRequestContextGetter* context_getter_; |
scoped_ptr<net::URLFetcher> fetcher_; |
- base::WeakPtrFactory<WebstoreSearchFetcher> weak_factory_; |
+ base::WeakPtrFactory<JSONResponseFetcher> weak_factory_; |
- DISALLOW_COPY_AND_ASSIGN(WebstoreSearchFetcher); |
+ DISALLOW_COPY_AND_ASSIGN(JSONResponseFetcher); |
}; |
} // namespace app_list |
-#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_WEBSTORE_SEARCH_FETCHER_H_ |
+#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_JSON_RESPONSE_FETCHER_H_ |