OLD | NEW |
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 #include "chrome/browser/ui/app_list/search/search_controller.h" | 5 #include "chrome/browser/ui/app_list/search/search_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 switches::kDisablePeopleSearch)) { | 88 switches::kDisablePeopleSearch)) { |
89 AddProvider(Mixer::PEOPLE_GROUP, scoped_ptr<SearchProvider>( | 89 AddProvider(Mixer::PEOPLE_GROUP, scoped_ptr<SearchProvider>( |
90 new PeopleProvider(profile_)).Pass()); | 90 new PeopleProvider(profile_)).Pass()); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 void SearchController::Start() { | 94 void SearchController::Start() { |
95 Stop(); | 95 Stop(); |
96 | 96 |
97 base::string16 query; | 97 base::string16 query; |
98 TrimWhitespace(search_box_->text(), TRIM_ALL, &query); | 98 base::TrimWhitespace(search_box_->text(), base::TRIM_ALL, &query); |
99 | 99 |
100 dispatching_query_ = true; | 100 dispatching_query_ = true; |
101 for (Providers::iterator it = providers_.begin(); | 101 for (Providers::iterator it = providers_.begin(); |
102 it != providers_.end(); | 102 it != providers_.end(); |
103 ++it) { | 103 ++it) { |
104 (*it)->Start(query); | 104 (*it)->Start(query); |
105 } | 105 } |
106 dispatching_query_ = false; | 106 dispatching_query_ = false; |
107 | 107 |
108 OnResultsChanged(); | 108 OnResultsChanged(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 173 } |
174 | 174 |
175 void SearchController::OnSpeechRecognitionStateChanged( | 175 void SearchController::OnSpeechRecognitionStateChanged( |
176 SpeechRecognitionState new_state) { | 176 SpeechRecognitionState new_state) { |
177 search_box_->SetHintText(l10n_util::GetStringUTF16( | 177 search_box_->SetHintText(l10n_util::GetStringUTF16( |
178 (new_state == SPEECH_RECOGNITION_HOTWORD_LISTENING) ? | 178 (new_state == SPEECH_RECOGNITION_HOTWORD_LISTENING) ? |
179 IDS_SEARCH_BOX_HOTWORD_HINT : IDS_SEARCH_BOX_HINT)); | 179 IDS_SEARCH_BOX_HOTWORD_HINT : IDS_SEARCH_BOX_HINT)); |
180 } | 180 } |
181 | 181 |
182 } // namespace app_list | 182 } // namespace app_list |
OLD | NEW |