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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 if (match != result.end()) { | 847 if (match != result.end()) { |
848 if ((match->inline_autocomplete_offset != string16::npos) && | 848 if ((match->inline_autocomplete_offset != string16::npos) && |
849 (match->inline_autocomplete_offset < | 849 (match->inline_autocomplete_offset < |
850 match->fill_into_edit.length())) { | 850 match->fill_into_edit.length())) { |
851 inline_autocomplete_text = | 851 inline_autocomplete_text = |
852 match->fill_into_edit.substr(match->inline_autocomplete_offset); | 852 match->fill_into_edit.substr(match->inline_autocomplete_offset); |
853 } | 853 } |
854 | 854 |
855 if (!match->destination_url.SchemeIs(chrome::kExtensionScheme)) { | 855 if (!match->destination_url.SchemeIs(chrome::kExtensionScheme)) { |
856 // Warm up DNS Prefetch cache, or preconnect to a search service. | 856 // Warm up DNS Prefetch cache, or preconnect to a search service. |
857 chrome_browser_net::AnticipateOmniboxUrl(match->destination_url, | 857 if (profile_->GetPredictor()) |
858 IsPreconnectable(match->type)); | 858 profile_->GetPredictor()->AnticipateOmniboxUrl( |
| 859 match->destination_url, |
| 860 IsPreconnectable(match->type)); |
859 } | 861 } |
860 | 862 |
861 // We could prefetch the alternate nav URL, if any, but because there | 863 // We could prefetch the alternate nav URL, if any, but because there |
862 // can be many of these as a user types an initial series of characters, | 864 // can be many of these as a user types an initial series of characters, |
863 // the OS DNS cache could suffer eviction problems for minimal gain. | 865 // the OS DNS cache could suffer eviction problems for minimal gain. |
864 | 866 |
865 is_keyword_hint = popup_->GetKeywordForMatch(*match, &keyword); | 867 is_keyword_hint = popup_->GetKeywordForMatch(*match, &keyword); |
866 } | 868 } |
867 popup_->OnResultChanged(); | 869 popup_->OnResultChanged(); |
868 OnPopupDataChanged(inline_autocomplete_text, NULL, keyword, | 870 OnPopupDataChanged(inline_autocomplete_text, NULL, keyword, |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 // static | 1015 // static |
1014 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { | 1016 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { |
1015 switch (c) { | 1017 switch (c) { |
1016 case 0x0020: // Space | 1018 case 0x0020: // Space |
1017 case 0x3000: // Ideographic Space | 1019 case 0x3000: // Ideographic Space |
1018 return true; | 1020 return true; |
1019 default: | 1021 default: |
1020 return false; | 1022 return false; |
1021 } | 1023 } |
1022 } | 1024 } |
OLD | NEW |