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

Unified Diff: chrome/browser/ui/app_list/search/common/webservice_search_provider.h

Issue 23874015: Implement people search. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/common/webservice_search_provider.h
diff --git a/chrome/browser/ui/app_list/search/common/webservice_search_provider.h b/chrome/browser/ui/app_list/search/common/webservice_search_provider.h
index 1b74b8e87856b445b40d3ff6bb884ad603eb0def..05bfd6751ad1806f1b9a1dd3e24a3a702511064a 100644
--- a/chrome/browser/ui/app_list/search/common/webservice_search_provider.h
+++ b/chrome/browser/ui/app_list/search/common/webservice_search_provider.h
@@ -11,24 +11,34 @@
#include "base/timer/timer.h"
#include "chrome/browser/ui/app_list/search/search_provider.h"
+class Profile;
+
namespace app_list {
// Helper class for webservice based searches.
class WebserviceSearchProvider : public SearchProvider {
public:
- WebserviceSearchProvider();
+ explicit WebserviceSearchProvider(Profile* profile);
virtual ~WebserviceSearchProvider();
+ // Validate the query for privacy and size.
+ bool IsValidQuery(const string16& query);
+
+ // Start a query with throttling enabled.
void StartThrottledQuery(const base::Closure& start_query);
- bool IsSensitiveInput(const string16& query);
void set_use_throttling(bool use) { use_throttling_ = use; }
+ protected:
+ Profile* profile_;
+
private:
+ bool IsSensitiveInput(const string16& query);
+
// The timestamp when the last key event happened.
base::Time last_keytyped_;
- // The timer to throttle QPS to the webstore search .
+ // The timer to throttle QPS.
base::OneShotTimer<WebserviceSearchProvider> query_throttler_;
// The flag for tests. It prevents the throttling If set to false.

Powered by Google App Engine
This is Rietveld 408576698