| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_builder.h" | 5 #include "chrome/browser/ui/app_list/search_builder.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 10 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 } else { | 251 } else { |
| 252 // TODO(xiyuan): What should we do for alternate url case? | 252 // TODO(xiyuan): What should we do for alternate url case? |
| 253 chrome::NavigateParams params(profile_, | 253 chrome::NavigateParams params(profile_, |
| 254 match.destination_url, | 254 match.destination_url, |
| 255 match.transition); | 255 match.transition); |
| 256 params.disposition = chrome::DispositionFromEventFlags(event_flags); | 256 params.disposition = chrome::DispositionFromEventFlags(event_flags); |
| 257 chrome::Navigate(¶ms); | 257 chrome::Navigate(¶ms); |
| 258 } | 258 } |
| 259 } | 259 } |
| 260 | 260 |
| 261 void SearchBuilder::InvokeResultAction(const app_list::SearchResult& result, |
| 262 int action_index, |
| 263 int event_flags) { |
| 264 NOTIMPLEMENTED(); |
| 265 } |
| 266 |
| 261 void SearchBuilder::PopulateFromACResult(const AutocompleteResult& ac_result) { | 267 void SearchBuilder::PopulateFromACResult(const AutocompleteResult& ac_result) { |
| 262 results_->DeleteAll(); | 268 results_->DeleteAll(); |
| 263 for (ACMatches::const_iterator it = ac_result.begin(); | 269 for (ACMatches::const_iterator it = ac_result.begin(); |
| 264 it != ac_result.end(); | 270 it != ac_result.end(); |
| 265 ++it) { | 271 ++it) { |
| 266 results_->Add(new SearchBuilderResult(profile_, *it)); | 272 results_->Add(new SearchBuilderResult(profile_, *it)); |
| 267 } | 273 } |
| 268 } | 274 } |
| 269 | 275 |
| 270 void SearchBuilder::OnResultChanged(bool default_match_changed) { | 276 void SearchBuilder::OnResultChanged(bool default_match_changed) { |
| 271 // TODO(xiyuan): Handle default match properly. | 277 // TODO(xiyuan): Handle default match properly. |
| 272 const AutocompleteResult& ac_result = controller_->result(); | 278 const AutocompleteResult& ac_result = controller_->result(); |
| 273 PopulateFromACResult(ac_result); | 279 PopulateFromACResult(ac_result); |
| 274 } | 280 } |
| OLD | NEW |