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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 match.transition = content::PAGE_TRANSITION_RELOAD; | 488 match.transition = content::PAGE_TRANSITION_RELOAD; |
489 } else if (for_drop || ((paste_state_ != NONE) && | 489 } else if (for_drop || ((paste_state_ != NONE) && |
490 match.is_history_what_you_typed_match)) { | 490 match.is_history_what_you_typed_match)) { |
491 // When the user pasted in a URL and hit enter, score it like a link click | 491 // When the user pasted in a URL and hit enter, score it like a link click |
492 // rather than a normal typed URL, so it doesn't get inline autocompleted | 492 // rather than a normal typed URL, so it doesn't get inline autocompleted |
493 // as aggressively later. | 493 // as aggressively later. |
494 match.transition = content::PAGE_TRANSITION_LINK; | 494 match.transition = content::PAGE_TRANSITION_LINK; |
495 } | 495 } |
496 | 496 |
497 const TemplateURL* template_url = match.GetTemplateURL(); | 497 const TemplateURL* template_url = match.GetTemplateURL(); |
498 if (template_url && template_url->url_ref().HasGoogleBaseURLs()) { | 498 if (template_url && template_url->url() && |
| 499 template_url->url()->HasGoogleBaseURLs()) { |
499 GoogleURLTracker::GoogleURLSearchCommitted(); | 500 GoogleURLTracker::GoogleURLSearchCommitted(); |
500 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 501 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) |
501 // TODO(pastarmovj): Remove these metrics once we have proven that (close | 502 // TODO(pastarmovj): Remove these metrics once we have proven that (close |
502 // to) none searches that should have RLZ are sent out without one. | 503 // to) none searches that should have RLZ are sent out without one. |
503 template_url->url()->CollectRLZMetrics(); | 504 template_url->url()->CollectRLZMetrics(); |
504 #endif | 505 #endif |
505 } | 506 } |
506 | 507 |
507 view_->OpenMatch(match, disposition, alternate_nav_url, | 508 view_->OpenMatch(match, disposition, alternate_nav_url, |
508 AutocompletePopupModel::kNoMatch); | 509 AutocompletePopupModel::kNoMatch); |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 // static | 1134 // static |
1134 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { | 1135 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { |
1135 switch (c) { | 1136 switch (c) { |
1136 case 0x0020: // Space | 1137 case 0x0020: // Space |
1137 case 0x3000: // Ideographic Space | 1138 case 0x3000: // Ideographic Space |
1138 return true; | 1139 return true; |
1139 default: | 1140 default: |
1140 return false; | 1141 return false; |
1141 } | 1142 } |
1142 } | 1143 } |
OLD | NEW |