OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/histogram.h" | 10 #include "base/histogram.h" |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 keyword_ui_state_ = NORMAL; | 665 keyword_ui_state_ = NORMAL; |
666 } else if ((keyword_ui_state_ != NO_KEYWORD) && !is_keyword_hint_ && | 666 } else if ((keyword_ui_state_ != NO_KEYWORD) && !is_keyword_hint_ && |
667 !keyword_.empty()) { | 667 !keyword_.empty()) { |
668 // Went from no selected keyword to a selected keyword. | 668 // Went from no selected keyword to a selected keyword. |
669 keyword_ui_state_ = KEYWORD; | 669 keyword_ui_state_ = KEYWORD; |
670 } | 670 } |
671 | 671 |
672 return true; | 672 return true; |
673 } | 673 } |
674 | 674 |
| 675 void AutocompleteEditModel::PopupBoundsChangedTo(const gfx::Rect& bounds) { |
| 676 #if defined(TOOLKIT_VIEWS) |
| 677 controller_->OnPopupBoundsChanged(bounds); |
| 678 #endif |
| 679 } |
| 680 |
675 // Return true if the suggestion type warrants a TCP/IP preconnection. | 681 // Return true if the suggestion type warrants a TCP/IP preconnection. |
676 // i.e., it is now highly likely that the user will select the related domain. | 682 // i.e., it is now highly likely that the user will select the related domain. |
677 static bool IsPreconnectable(AutocompleteMatch::Type type) { | 683 static bool IsPreconnectable(AutocompleteMatch::Type type) { |
678 UMA_HISTOGRAM_ENUMERATION("Autocomplete.MatchType", type, | 684 UMA_HISTOGRAM_ENUMERATION("Autocomplete.MatchType", type, |
679 AutocompleteMatch::NUM_TYPES); | 685 AutocompleteMatch::NUM_TYPES); |
680 switch (type) { | 686 switch (type) { |
681 // Matches using the user's default search engine. | 687 // Matches using the user's default search engine. |
682 case AutocompleteMatch::SEARCH_WHAT_YOU_TYPED: | 688 case AutocompleteMatch::SEARCH_WHAT_YOU_TYPED: |
683 case AutocompleteMatch::SEARCH_HISTORY: | 689 case AutocompleteMatch::SEARCH_HISTORY: |
684 case AutocompleteMatch::SEARCH_SUGGEST: | 690 case AutocompleteMatch::SEARCH_SUGGEST: |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 AutocompleteMatch* match, | 758 AutocompleteMatch* match, |
753 GURL* alternate_nav_url) const { | 759 GURL* alternate_nav_url) const { |
754 if (popup_->IsOpen() || query_in_progress()) { | 760 if (popup_->IsOpen() || query_in_progress()) { |
755 popup_->InfoForCurrentSelection(match, alternate_nav_url); | 761 popup_->InfoForCurrentSelection(match, alternate_nav_url); |
756 } else { | 762 } else { |
757 profile_->GetAutocompleteClassifier()->Classify( | 763 profile_->GetAutocompleteClassifier()->Classify( |
758 UserTextFromDisplayText(view_->GetText()), GetDesiredTLD(), match, | 764 UserTextFromDisplayText(view_->GetText()), GetDesiredTLD(), match, |
759 alternate_nav_url); | 765 alternate_nav_url); |
760 } | 766 } |
761 } | 767 } |
OLD | NEW |