Update V8 to version 4.6.55.
[chromium-blink-merge.git] / ui / app_list / search_provider.h
blob92e8e5bf5044d33cf6015a0b811089336e44a6cf
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_APP_LIST_SEARCH_PROVIDER_H_
6 #define UI_APP_LIST_SEARCH_PROVIDER_H_
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/scoped_vector.h"
12 #include "base/strings/string16.h"
13 #include "ui/app_list/app_list_export.h"
15 namespace app_list {
17 class SearchResult;
19 class APP_LIST_EXPORT SearchProvider {
20 public:
21 typedef ScopedVector<SearchResult> Results;
22 typedef base::Closure ResultChangedCallback;
24 SearchProvider();
25 virtual ~SearchProvider();
27 // Invoked to start a query.
28 virtual void Start(bool is_voice_query, const base::string16& query) = 0;
30 // Invoked to stop the current query and no more results changes.
31 virtual void Stop() = 0;
33 void set_result_changed_callback(const ResultChangedCallback& callback) {
34 result_changed_callback_ = callback;
37 const Results& results() const { return results_; }
39 protected:
40 // Interface for the derived class to generate search results.
41 void Add(scoped_ptr<SearchResult> result);
42 void ClearResults();
44 private:
45 void FireResultChanged();
47 ResultChangedCallback result_changed_callback_;
48 Results results_;
50 DISALLOW_COPY_AND_ASSIGN(SearchProvider);
53 } // namespace app_list
55 #endif // UI_APP_LIST_SEARCH_PROVIDER_H_