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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_controller.cc

Issue 18878007: Omnibox: Make the Controller Reorder Matches for Inlining (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 months 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_match.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/autocomplete/autocomplete_controller.h" 5 #include "chrome/browser/autocomplete/autocomplete_controller.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 // Only add the keyword if the match does not have a duplicate keyword with 467 // Only add the keyword if the match does not have a duplicate keyword with
468 // a more relevant match. 468 // a more relevant match.
469 keyword = match->associated_keyword.get() ? 469 keyword = match->associated_keyword.get() ?
470 match->associated_keyword->keyword : 470 match->associated_keyword->keyword :
471 keyword_provider_->GetKeywordForText(match->fill_into_edit); 471 keyword_provider_->GetKeywordForText(match->fill_into_edit);
472 if (!keyword.empty() && !keywords.count(keyword)) { 472 if (!keyword.empty() && !keywords.count(keyword)) {
473 keywords.insert(keyword); 473 keywords.insert(keyword);
474 474
475 if (!match->associated_keyword.get()) 475 if (!match->associated_keyword.get())
476 match->associated_keyword.reset(new AutocompleteMatch( 476 match->associated_keyword.reset(new AutocompleteMatch(
477 keyword_provider_->CreateAutocompleteMatch(match->fill_into_edit, 477 keyword_provider_->CreateVerbatimMatch(match->fill_into_edit,
478 keyword, input_))); 478 keyword, input_)));
479 } else { 479 } else {
480 match->associated_keyword.reset(); 480 match->associated_keyword.reset();
481 } 481 }
482 } 482 }
483 } 483 }
484 484
485 void AutocompleteController::UpdateAssistedQueryStats( 485 void AutocompleteController::UpdateAssistedQueryStats(
486 AutocompleteResult* result) { 486 AutocompleteResult* result) {
487 if (result->empty()) 487 if (result->empty())
488 return; 488 return;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 // the disruptive effect of belated omnibox updates, updates that 632 // the disruptive effect of belated omnibox updates, updates that
633 // come after the user has had to time to read the whole dropdown 633 // come after the user has had to time to read the whole dropdown
634 // and doesn't expect it to change. 634 // and doesn't expect it to change.
635 const int kStopTimeMS = 1500; 635 const int kStopTimeMS = 1500;
636 stop_timer_.Start(FROM_HERE, 636 stop_timer_.Start(FROM_HERE,
637 base::TimeDelta::FromMilliseconds(kStopTimeMS), 637 base::TimeDelta::FromMilliseconds(kStopTimeMS),
638 base::Bind(&AutocompleteController::Stop, 638 base::Bind(&AutocompleteController::Stop,
639 base::Unretained(this), 639 base::Unretained(this),
640 false)); 640 false));
641 } 641 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_match.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698