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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 void AutocompleteEditModel::SetUserText(const string16& text) { | 148 void AutocompleteEditModel::SetUserText(const string16& text) { |
149 SetInputInProgress(true); | 149 SetInputInProgress(true); |
150 InternalSetUserText(text); | 150 InternalSetUserText(text); |
151 paste_state_ = NONE; | 151 paste_state_ = NONE; |
152 has_temporary_text_ = false; | 152 has_temporary_text_ = false; |
153 } | 153 } |
154 | 154 |
155 void AutocompleteEditModel::FinalizeInstantQuery( | 155 void AutocompleteEditModel::FinalizeInstantQuery( |
156 const string16& input_text, | 156 const string16& input_text, |
157 const string16& suggest_text) { | 157 const string16& suggest_text, |
158 popup_->FinalizeInstantQuery(input_text, suggest_text); | 158 bool skip_inline_autocomplete) { |
| 159 if (skip_inline_autocomplete) { |
| 160 const string16 final_text = input_text + suggest_text; |
| 161 view_->OnBeforePossibleChange(); |
| 162 view_->SetWindowTextAndCaretPos(final_text, final_text.length()); |
| 163 view_->OnAfterPossibleChange(); |
| 164 } else { |
| 165 popup_->FinalizeInstantQuery(input_text, suggest_text); |
| 166 } |
159 } | 167 } |
160 | 168 |
161 void AutocompleteEditModel::GetDataForURLExport(GURL* url, | 169 void AutocompleteEditModel::GetDataForURLExport(GURL* url, |
162 string16* title, | 170 string16* title, |
163 SkBitmap* favicon) { | 171 SkBitmap* favicon) { |
164 AutocompleteMatch match; | 172 AutocompleteMatch match; |
165 GetInfoForCurrentText(&match, NULL); | 173 GetInfoForCurrentText(&match, NULL); |
166 *url = match.destination_url; | 174 *url = match.destination_url; |
167 if (*url == URLFixerUpper::FixupURL(UTF16ToUTF8(permanent_text_), | 175 if (*url == URLFixerUpper::FixupURL(UTF16ToUTF8(permanent_text_), |
168 std::string())) { | 176 std::string())) { |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 // static | 814 // static |
807 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { | 815 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { |
808 switch (c) { | 816 switch (c) { |
809 case 0x0020: // Space | 817 case 0x0020: // Space |
810 case 0x3000: // Ideographic Space | 818 case 0x3000: // Ideographic Space |
811 return true; | 819 return true; |
812 default: | 820 default: |
813 return false; | 821 return false; |
814 } | 822 } |
815 } | 823 } |
OLD | NEW |