| 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/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 Loading... |
| 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_->CreateWhatYouTypedMatch(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()) |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |