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

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

Issue 882463004: app_list: Refactor mixer groups to avoid hard-coded groups in Mixer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@applist-mixer-clamp
Patch Set: Init omnibox_group_ and use in-class initialization. Created 5 years, 8 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
« no previous file with comments | « ui/app_list/search/mixer_unittest.cc ('k') | ui/app_list/search_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_CONTROLLER_H_ 5 #ifndef UI_APP_LIST_SEARCH_CONTROLLER_H_
6 #define UI_APP_LIST_SEARCH_CONTROLLER_H_ 6 #define UI_APP_LIST_SEARCH_CONTROLLER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 21 matching lines...) Expand all
32 virtual ~SearchController(); 32 virtual ~SearchController();
33 33
34 void Start(bool is_voice_query); 34 void Start(bool is_voice_query);
35 void Stop(); 35 void Stop();
36 36
37 void OpenResult(SearchResult* result, int event_flags); 37 void OpenResult(SearchResult* result, int event_flags);
38 void InvokeResultAction(SearchResult* result, 38 void InvokeResultAction(SearchResult* result,
39 int action_index, 39 int action_index,
40 int event_flags); 40 int event_flags);
41 41
42 // Adds a new mixer group. See Mixer::AddGroup.
43 size_t AddGroup(size_t max_results, double boost);
44
45 // Adds a new mixer group. See Mixer::AddOmniboxGroup.
46 size_t AddOmniboxGroup(size_t max_results, double boost);
47
42 // Takes ownership of |provider| and associates it with given mixer group. 48 // Takes ownership of |provider| and associates it with given mixer group.
43 void AddProvider(Mixer::GroupId group, 49 void AddProvider(size_t group_id, scoped_ptr<SearchProvider> provider);
44 scoped_ptr<SearchProvider> provider);
45 50
46 private: 51 private:
47 typedef ScopedVector<SearchProvider> Providers; 52 typedef ScopedVector<SearchProvider> Providers;
48 53
49 // Invoked when the search results are changed. 54 // Invoked when the search results are changed.
50 void OnResultsChanged(); 55 void OnResultsChanged();
51 56
52 SearchBoxModel* search_box_; 57 SearchBoxModel* search_box_;
53 58
54 bool dispatching_query_; 59 bool dispatching_query_;
55 Providers providers_; 60 Providers providers_;
56 scoped_ptr<Mixer> mixer_; 61 scoped_ptr<Mixer> mixer_;
57 History* history_; // KeyedService, not owned. 62 History* history_; // KeyedService, not owned.
58 63
59 bool is_voice_query_; 64 bool is_voice_query_;
60 65
61 base::OneShotTimer<SearchController> stop_timer_; 66 base::OneShotTimer<SearchController> stop_timer_;
62 67
63 DISALLOW_COPY_AND_ASSIGN(SearchController); 68 DISALLOW_COPY_AND_ASSIGN(SearchController);
64 }; 69 };
65 70
66 } // namespace app_list 71 } // namespace app_list
67 72
68 #endif // UI_APP_LIST_SEARCH_CONTROLLER_H_ 73 #endif // UI_APP_LIST_SEARCH_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ui/app_list/search/mixer_unittest.cc ('k') | ui/app_list/search_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698