OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_edit.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 else if (!has_temporary_text_) | 393 else if (!has_temporary_text_) |
394 log->inline_autocompleted_length = inline_autocomplete_text_.length(); | 394 log->inline_autocompleted_length = inline_autocomplete_text_.length(); |
395 NotificationService::current()->Notify( | 395 NotificationService::current()->Notify( |
396 NotificationType::OMNIBOX_OPENED_URL, Source<Profile>(profile_), | 396 NotificationType::OMNIBOX_OPENED_URL, Source<Profile>(profile_), |
397 Details<AutocompleteLog>(log.get())); | 397 Details<AutocompleteLog>(log.get())); |
398 } | 398 } |
399 | 399 |
400 TemplateURLModel* template_url_model = profile_->GetTemplateURLModel(); | 400 TemplateURLModel* template_url_model = profile_->GetTemplateURLModel(); |
401 if (template_url_model && !keyword.empty()) { | 401 if (template_url_model && !keyword.empty()) { |
402 const TemplateURL* const template_url = | 402 const TemplateURL* const template_url = |
403 template_url_model->GetTemplateURLForKeyword(WideToUTF16Hack(keyword)); | 403 template_url_model->GetTemplateURLForKeyword(keyword); |
404 | 404 |
405 // Special case for extension keywords. Don't increment usage count for | 405 // Special case for extension keywords. Don't increment usage count for |
406 // these. | 406 // these. |
407 if (template_url && template_url->IsExtensionKeyword()) { | 407 if (template_url && template_url->IsExtensionKeyword()) { |
408 AutocompleteMatch current_match; | 408 AutocompleteMatch current_match; |
409 GetInfoForCurrentText(¤t_match, NULL); | 409 GetInfoForCurrentText(¤t_match, NULL); |
410 | 410 |
411 const AutocompleteMatch& match = | 411 const AutocompleteMatch& match = |
412 index == AutocompletePopupModel::kNoMatch ? | 412 index == AutocompletePopupModel::kNoMatch ? |
413 current_match : result().match_at(index); | 413 current_match : result().match_at(index); |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 i->inline_autocomplete_offset != std::wstring::npos) { | 827 i->inline_autocomplete_offset != std::wstring::npos) { |
828 suggested_text = WideToUTF16(i->fill_into_edit.substr( | 828 suggested_text = WideToUTF16(i->fill_into_edit.substr( |
829 i->inline_autocomplete_offset)); | 829 i->inline_autocomplete_offset)); |
830 break; | 830 break; |
831 } | 831 } |
832 } | 832 } |
833 } | 833 } |
834 } | 834 } |
835 controller_->OnSetSuggestedSearchText(suggested_text); | 835 controller_->OnSetSuggestedSearchText(suggested_text); |
836 } | 836 } |
OLD | NEW |