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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 if (template_url->IsExtensionKeyword()) { | 562 if (template_url->IsExtensionKeyword()) { |
563 AutocompleteMatch current_match; | 563 AutocompleteMatch current_match; |
564 GetInfoForCurrentText(¤t_match, NULL); | 564 GetInfoForCurrentText(¤t_match, NULL); |
565 | 565 |
566 const AutocompleteMatch& match = | 566 const AutocompleteMatch& match = |
567 (index == AutocompletePopupModel::kNoMatch) ? | 567 (index == AutocompletePopupModel::kNoMatch) ? |
568 current_match : result().match_at(index); | 568 current_match : result().match_at(index); |
569 | 569 |
570 // Strip the keyword + leading space off the input. | 570 // Strip the keyword + leading space off the input. |
571 size_t prefix_length = match.keyword.length() + 1; | 571 size_t prefix_length = match.keyword.length() + 1; |
572 extensions::ExtensionOmniboxEventRouter::OnInputEntered(profile_, | 572 extensions::ExtensionOmniboxEventRouter::OnInputEntered( |
| 573 controller_->GetTabContents(), |
573 template_url->GetExtensionId(), | 574 template_url->GetExtensionId(), |
574 UTF16ToUTF8(match.fill_into_edit.substr(prefix_length))); | 575 UTF16ToUTF8(match.fill_into_edit.substr(prefix_length))); |
575 view_->RevertAll(); | 576 view_->RevertAll(); |
576 return; | 577 return; |
577 } | 578 } |
578 | 579 |
579 content::RecordAction(UserMetricsAction("AcceptedKeyword")); | 580 content::RecordAction(UserMetricsAction("AcceptedKeyword")); |
580 TemplateURLServiceFactory::GetForProfile(profile_)->IncrementUsageCount( | 581 TemplateURLServiceFactory::GetForProfile(profile_)->IncrementUsageCount( |
581 template_url); | 582 template_url); |
582 } else { | 583 } else { |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 return metrics::OmniboxEventProto_PageClassification_INVALID_SPEC; | 1153 return metrics::OmniboxEventProto_PageClassification_INVALID_SPEC; |
1153 const std::string& url = gurl.spec(); | 1154 const std::string& url = gurl.spec(); |
1154 if (url == chrome::kChromeUINewTabURL) | 1155 if (url == chrome::kChromeUINewTabURL) |
1155 return metrics::OmniboxEventProto_PageClassification_NEW_TAB_PAGE; | 1156 return metrics::OmniboxEventProto_PageClassification_NEW_TAB_PAGE; |
1156 if (url == chrome::kAboutBlankURL) | 1157 if (url == chrome::kAboutBlankURL) |
1157 return metrics::OmniboxEventProto_PageClassification_BLANK; | 1158 return metrics::OmniboxEventProto_PageClassification_BLANK; |
1158 if (url == profile()->GetPrefs()->GetString(prefs::kHomePage)) | 1159 if (url == profile()->GetPrefs()->GetString(prefs::kHomePage)) |
1159 return metrics::OmniboxEventProto_PageClassification_HOMEPAGE; | 1160 return metrics::OmniboxEventProto_PageClassification_HOMEPAGE; |
1160 return metrics::OmniboxEventProto_PageClassification_OTHER; | 1161 return metrics::OmniboxEventProto_PageClassification_OTHER; |
1161 } | 1162 } |
OLD | NEW |