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

Side by Side Diff: ui/app_list/search_provider.h

Issue 621823004: Simplifies the structure of app_list search a bit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_APP_LIST_SEARCH_PROVIDER_H_ 5 #ifndef UI_APP_LIST_SEARCH_PROVIDER_H_
6 #define UI_APP_LIST_SEARCH_PROVIDER_H_ 6 #define UI_APP_LIST_SEARCH_PROVIDER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 16 matching lines...) Expand all
27 // Invoked to start a query. 27 // Invoked to start a query.
28 virtual void Start(const base::string16& query) = 0; 28 virtual void Start(const base::string16& query) = 0;
29 29
30 // Invoked to stop the current query and no more results changes. 30 // Invoked to stop the current query and no more results changes.
31 virtual void Stop() = 0; 31 virtual void Stop() = 0;
32 32
33 void set_result_changed_callback(const ResultChangedCallback& callback) { 33 void set_result_changed_callback(const ResultChangedCallback& callback) {
34 result_changed_callback_ = callback; 34 result_changed_callback_ = callback;
35 } 35 }
36 36
37 // TODO(mukai): Fix the ownership and copying of the results.
38 void ReleaseResult(std::vector<SearchResult*>* results);
39
40 const Results& results() const { return results_; } 37 const Results& results() const { return results_; }
41 38
42 protected: 39 protected:
43 // Interface for the derived class to generate search results. 40 // Interface for the derived class to generate search results.
44 void Add(scoped_ptr<SearchResult> result); 41 void Add(scoped_ptr<SearchResult> result);
45 void ClearResults(); 42 void ClearResults();
46 43
47 private: 44 private:
48 void FireResultChanged(); 45 void FireResultChanged();
49 46
50 ResultChangedCallback result_changed_callback_; 47 ResultChangedCallback result_changed_callback_;
51 Results results_; 48 Results results_;
52 49
53 DISALLOW_COPY_AND_ASSIGN(SearchProvider); 50 DISALLOW_COPY_AND_ASSIGN(SearchProvider);
54 }; 51 };
55 52
56 } // namespace app_list 53 } // namespace app_list
57 54
58 #endif // UI_APP_LIST_SEARCH_PROVIDER_H_ 55 #endif // UI_APP_LIST_SEARCH_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698