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

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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 controller_.reset(new AutocompleteController(profile, this, providers)); 319 controller_.reset(new AutocompleteController(profile, this, providers));
320 } 320 }
321 321
322 SearchBuilder::~SearchBuilder() { 322 SearchBuilder::~SearchBuilder() {
323 } 323 }
324 324
325 void SearchBuilder::StartSearch() { 325 void SearchBuilder::StartSearch() {
326 // Omnibox features such as keyword selection/accepting and instant query 326 // Omnibox features such as keyword selection/accepting and instant query
327 // are not implemented. 327 // are not implemented.
328 // TODO(xiyuan): Figure out the features that need to support here. 328 // TODO(xiyuan): Figure out the features that need to support here.
329 controller_->Start(search_box_->text(), string16(), false, false, true, 329 controller_->Start(AutocompleteInput(search_box_->text(), string16::npos,
330 AutocompleteInput::ALL_MATCHES); 330 string16(), false, false, true,
331 AutocompleteInput::ALL_MATCHES));
331 } 332 }
332 333
333 void SearchBuilder::StopSearch() { 334 void SearchBuilder::StopSearch() {
334 controller_->Stop(true); 335 controller_->Stop(true);
335 } 336 }
336 337
337 void SearchBuilder::OpenResult(const app_list::SearchResult& result, 338 void SearchBuilder::OpenResult(const app_list::SearchResult& result,
338 int event_flags) { 339 int event_flags) {
339 const SearchBuilderResult* builder_result = 340 const SearchBuilderResult* builder_result =
340 static_cast<const SearchBuilderResult*>(&result); 341 static_cast<const SearchBuilderResult*>(&result);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 result->Init(profile_, *it); 433 result->Init(profile_, *it);
433 results_->Add(result); 434 results_->Add(result);
434 } 435 }
435 } 436 }
436 437
437 void SearchBuilder::OnResultChanged(bool default_match_changed) { 438 void SearchBuilder::OnResultChanged(bool default_match_changed) {
438 // TODO(xiyuan): Handle default match properly. 439 // TODO(xiyuan): Handle default match properly.
439 const AutocompleteResult& ac_result = controller_->result(); 440 const AutocompleteResult& ac_result = controller_->result();
440 PopulateFromACResult(ac_result); 441 PopulateFromACResult(ac_result);
441 } 442 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698