Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4351)

Unified Diff: chrome/browser/ui/app_list/search/webstore_provider.h

Issue 15342003: app_list: Add web store search. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and address nits in #3 Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/search/webstore_provider.h
diff --git a/chrome/browser/ui/app_list/search/webstore_provider.h b/chrome/browser/ui/app_list/search/webstore_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb0fba6a893ba77673c2b57bea8a3600f131e4ed
--- /dev/null
+++ b/chrome/browser/ui/app_list/search/webstore_provider.h
@@ -0,0 +1,61 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// 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_PROVIDER_H_
+#define CHROME_BROWSER_UI_APP_LIST_SEARCH_WEBSTORE_PROVIDER_H_
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/app_list/search/search_provider.h"
+
+class Profile;
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace app_list {
+
+namespace test {
+class WebstoreProviderTest;
+}
+
+class ChromeSearchResult;
+class WebstoreSearchFetcher;
+
+// WebstoreProvider fetches search results from the web store server.
+// A "Search in web store" result will be returned if the server does not
+// return any results.
+class WebstoreProvider : public SearchProvider {
+ public:
+ explicit WebstoreProvider(Profile* profile);
+ virtual ~WebstoreProvider();
+
+ // SearchProvider overrides:
+ virtual void Start(const base::string16& query) OVERRIDE;
+ virtual void Stop() OVERRIDE;
+
+ private:
+ friend class app_list::test::WebstoreProviderTest;
+
+ void OnWebstoreSearchFetched(scoped_ptr<base::DictionaryValue> json);
+ void ProcessWebstoreSearchResults(base::DictionaryValue* json);
+ scoped_ptr<ChromeSearchResult> CreateResult(
+ const base::DictionaryValue& dict);
+
+ void set_webstore_search_fetched_callback(const base::Closure& callback) {
+ webstore_search_fetched_callback_ = callback;
+ }
+
+ Profile* profile_;
+ scoped_ptr<WebstoreSearchFetcher> webstore_search_;
+ base::Closure webstore_search_fetched_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebstoreProvider);
+};
+
+} // namespace app_list
+
+#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_WEBSTORE_PROVIDER_H_
« no previous file with comments | « chrome/browser/ui/app_list/search/search_webstore_result.cc ('k') | chrome/browser/ui/app_list/search/webstore_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698