| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 controller_.reset(new AutocompleteController(profile, this, providers)); | 324 controller_.reset(new AutocompleteController(profile, this, providers)); |
| 325 } | 325 } |
| 326 | 326 |
| 327 SearchBuilder::~SearchBuilder() { | 327 SearchBuilder::~SearchBuilder() { |
| 328 } | 328 } |
| 329 | 329 |
| 330 void SearchBuilder::StartSearch() { | 330 void SearchBuilder::StartSearch() { |
| 331 // Omnibox features such as keyword selection/accepting and instant query | 331 // Omnibox features such as keyword selection/accepting and instant query |
| 332 // are not implemented. | 332 // are not implemented. |
| 333 // TODO(xiyuan): Figure out the features that need to support here. | 333 // TODO(xiyuan): Figure out the features that need to support here. |
| 334 controller_->Start(search_box_->text(), string16(), false, false, true, | 334 controller_->Start(AutocompleteInput(search_box_->text(), string16::npos, |
| 335 AutocompleteInput::ALL_MATCHES); | 335 string16(), false, false, true, |
| 336 AutocompleteInput::ALL_MATCHES)); |
| 336 } | 337 } |
| 337 | 338 |
| 338 void SearchBuilder::StopSearch() { | 339 void SearchBuilder::StopSearch() { |
| 339 controller_->Stop(true); | 340 controller_->Stop(true); |
| 340 } | 341 } |
| 341 | 342 |
| 342 void SearchBuilder::OpenResult(const app_list::SearchResult& result, | 343 void SearchBuilder::OpenResult(const app_list::SearchResult& result, |
| 343 int event_flags) { | 344 int event_flags) { |
| 344 const SearchBuilderResult* builder_result = | 345 const SearchBuilderResult* builder_result = |
| 345 static_cast<const SearchBuilderResult*>(&result); | 346 static_cast<const SearchBuilderResult*>(&result); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 result->Init(profile_, *it); | 438 result->Init(profile_, *it); |
| 438 results_->Add(result); | 439 results_->Add(result); |
| 439 } | 440 } |
| 440 } | 441 } |
| 441 | 442 |
| 442 void SearchBuilder::OnResultChanged(bool default_match_changed) { | 443 void SearchBuilder::OnResultChanged(bool default_match_changed) { |
| 443 // TODO(xiyuan): Handle default match properly. | 444 // TODO(xiyuan): Handle default match properly. |
| 444 const AutocompleteResult& ac_result = controller_->result(); | 445 const AutocompleteResult& ac_result = controller_->result(); |
| 445 PopulateFromACResult(ac_result); | 446 PopulateFromACResult(ac_result); |
| 446 } | 447 } |
| OLD | NEW |