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

Side by Side Diff: chrome/browser/ui/app_list/search_builder.cc

Issue 11414303: Make Google Search autocomplete provider cursor aware. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years 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 | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698