OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/omnibox/omnibox_edit_model.h" | 5 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
710 const GURL destination_url = autocomplete_controller()-> | 710 const GURL destination_url = autocomplete_controller()-> |
711 GetDestinationURL(match, query_formulation_time); | 711 GetDestinationURL(match, query_formulation_time); |
712 | 712 |
713 RecordPercentageMatchHistogram( | 713 RecordPercentageMatchHistogram( |
714 permanent_text_, current_text, | 714 permanent_text_, current_text, |
715 view_->toolbar_model()->WouldReplaceSearchURLWithSearchTerms(false), | 715 view_->toolbar_model()->WouldReplaceSearchURLWithSearchTerms(false), |
716 match.transition); | 716 match.transition); |
717 | 717 |
718 // Track whether the destination URL sends us to a search results page | 718 // Track whether the destination URL sends us to a search results page |
719 // using the default search provider. | 719 // using the default search provider. |
720 TemplateURL* default_provider = | 720 bool is_search_results = |
Peter Kasting
2013/07/31 23:56:51
Nit: Not the best name; instead of trying to think
rpetterson
2013/08/05 19:46:12
Done.
| |
721 TemplateURLServiceFactory::GetForProfile(profile_)-> | 721 TemplateURLServiceFactory::GetForProfile(profile_)-> |
722 GetDefaultSearchProvider(); | 722 IsSearchResultsPageFromDefaultSearchProvider(destination_url); |
723 if (default_provider && default_provider->IsSearchURL(destination_url)) | 723 if (is_search_results) |
Peter Kasting
2013/07/31 23:56:51
Nit: While here: {}
rpetterson
2013/08/05 19:46:12
Done.
| |
724 content::RecordAction( | 724 content::RecordAction( |
725 UserMetricsAction("OmniboxDestinationURLIsSearchOnDSP")); | 725 UserMetricsAction("OmniboxDestinationURLIsSearchOnDSP")); |
726 | 726 |
727 // This calls RevertAll again. | 727 // This calls RevertAll again. |
728 base::AutoReset<bool> tmp(&in_revert_, true); | 728 base::AutoReset<bool> tmp(&in_revert_, true); |
729 controller_->OnAutocompleteAccept(destination_url, disposition, | 729 controller_->OnAutocompleteAccept(destination_url, disposition, |
730 match.transition, alternate_nav_url); | 730 match.transition, alternate_nav_url); |
731 } | 731 } |
732 | 732 |
733 if (match.starred) | 733 if (match.starred) |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1296 instant->OmniboxFocusChanged(state, reason, NULL); | 1296 instant->OmniboxFocusChanged(state, reason, NULL); |
1297 | 1297 |
1298 // Update state and notify view if the omnibox has focus and the caret | 1298 // Update state and notify view if the omnibox has focus and the caret |
1299 // visibility changed. | 1299 // visibility changed. |
1300 const bool was_caret_visible = is_caret_visible(); | 1300 const bool was_caret_visible = is_caret_visible(); |
1301 focus_state_ = state; | 1301 focus_state_ = state; |
1302 if (focus_state_ != OMNIBOX_FOCUS_NONE && | 1302 if (focus_state_ != OMNIBOX_FOCUS_NONE && |
1303 is_caret_visible() != was_caret_visible) | 1303 is_caret_visible() != was_caret_visible) |
1304 view_->ApplyCaretVisibility(); | 1304 view_->ApplyCaretVisibility(); |
1305 } | 1305 } |
OLD | NEW |