OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 380 |
381 // Prefix the text with 'http://' if the text doesn't start with 'http://', | 381 // Prefix the text with 'http://' if the text doesn't start with 'http://', |
382 // the text parses as a url with a scheme of http, the user selected the | 382 // the text parses as a url with a scheme of http, the user selected the |
383 // entire host, and the user hasn't edited the host or manually removed the | 383 // entire host, and the user hasn't edited the host or manually removed the |
384 // scheme. | 384 // scheme. |
385 GURL perm_url(PermanentURL()); | 385 GURL perm_url(PermanentURL()); |
386 if (perm_url.SchemeIs(chrome::kHttpScheme) && | 386 if (perm_url.SchemeIs(chrome::kHttpScheme) && |
387 url->SchemeIs(chrome::kHttpScheme) && perm_url.host() == url->host()) { | 387 url->SchemeIs(chrome::kHttpScheme) && perm_url.host() == url->host()) { |
388 *write_url = true; | 388 *write_url = true; |
389 string16 http = ASCIIToUTF16(chrome::kHttpScheme) + | 389 string16 http = ASCIIToUTF16(chrome::kHttpScheme) + |
390 ASCIIToUTF16(chrome::kStandardSchemeSeparator); | 390 ASCIIToUTF16(content::kStandardSchemeSeparator); |
391 if (text->compare(0, http.length(), http) != 0) | 391 if (text->compare(0, http.length(), http) != 0) |
392 *text = http + *text; | 392 *text = http + *text; |
393 } | 393 } |
394 } | 394 } |
395 | 395 |
396 void AutocompleteEditModel::SetInputInProgress(bool in_progress) { | 396 void AutocompleteEditModel::SetInputInProgress(bool in_progress) { |
397 if (user_input_in_progress_ == in_progress) | 397 if (user_input_in_progress_ == in_progress) |
398 return; | 398 return; |
399 | 399 |
400 user_input_in_progress_ = in_progress; | 400 user_input_in_progress_ = in_progress; |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 // static | 1131 // static |
1132 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { | 1132 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { |
1133 switch (c) { | 1133 switch (c) { |
1134 case 0x0020: // Space | 1134 case 0x0020: // Space |
1135 case 0x3000: // Ideographic Space | 1135 case 0x3000: // Ideographic Space |
1136 return true; | 1136 return true; |
1137 default: | 1137 default: |
1138 return false; | 1138 return false; |
1139 } | 1139 } |
1140 } | 1140 } |
OLD | NEW |