| 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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 | 1012 |
| 1013 TabContentsWrapper* tab = controller_->GetTabContentsWrapper(); | 1013 TabContentsWrapper* tab = controller_->GetTabContentsWrapper(); |
| 1014 | 1014 |
| 1015 if (!tab) | 1015 if (!tab) |
| 1016 return false; | 1016 return false; |
| 1017 | 1017 |
| 1018 if (user_input_in_progress() && popup_->IsOpen()) { | 1018 if (user_input_in_progress() && popup_->IsOpen()) { |
| 1019 return instant->Update(tab, match, view_->GetText(), UseVerbatimInstant(), | 1019 return instant->Update(tab, match, view_->GetText(), UseVerbatimInstant(), |
| 1020 suggested_text); | 1020 suggested_text); |
| 1021 } else { | 1021 } else { |
| 1022 instant->DestroyPreviewContentsAndLeaveActive(); | 1022 instant->Hide(); |
| 1023 return false; | 1023 return false; |
| 1024 } | 1024 } |
| 1025 } | 1025 } |
| 1026 | 1026 |
| 1027 void AutocompleteEditModel::DoPrerender(const AutocompleteMatch& match) { | 1027 void AutocompleteEditModel::DoPrerender(const AutocompleteMatch& match) { |
| 1028 // Do not prerender if the destination URL is the same as the current URL. | 1028 // Do not prerender if the destination URL is the same as the current URL. |
| 1029 if (match.destination_url == PermanentURL()) | 1029 if (match.destination_url == PermanentURL()) |
| 1030 return; | 1030 return; |
| 1031 if (user_input_in_progress() && popup_->IsOpen()) { | 1031 if (user_input_in_progress() && popup_->IsOpen()) { |
| 1032 TabContentsWrapper* tab = controller_->GetTabContentsWrapper(); | 1032 TabContentsWrapper* tab = controller_->GetTabContentsWrapper(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1056 // static | 1056 // static |
| 1057 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { | 1057 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { |
| 1058 switch (c) { | 1058 switch (c) { |
| 1059 case 0x0020: // Space | 1059 case 0x0020: // Space |
| 1060 case 0x3000: // Ideographic Space | 1060 case 0x3000: // Ideographic Space |
| 1061 return true; | 1061 return true; |
| 1062 default: | 1062 default: |
| 1063 return false; | 1063 return false; |
| 1064 } | 1064 } |
| 1065 } | 1065 } |
| OLD | NEW |