Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 17426004: Minor cosmetic changes to OmniboxEditModel and OmniboxController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Answered Peter Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_edit_model.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index 99d6680a61c2b25037ef01a9392999f144ad9348..ad02ee328b54649ad981893a2514ddb8cbe068ec 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -187,10 +187,14 @@ void OmniboxEditModel::RestoreState(const State& state) {
AutocompleteMatch OmniboxEditModel::CurrentMatch(
GURL* alternate_nav_url) const {
// If we have a valid match use it. Otherwise get one for the current text.
- AutocompleteMatch match =
- omnibox_controller_->CurrentMatch(alternate_nav_url);
- if (!match.destination_url.is_valid())
+ AutocompleteMatch match = omnibox_controller_->current_match();
+
+ if (!match.destination_url.is_valid()) {
GetInfoForCurrentText(&match, alternate_nav_url);
+ } else if (alternate_nav_url) {
+ *alternate_nav_url = AutocompleteResult::ComputeAlternateNavUrl(
+ autocomplete_controller()->input(), match);
+ }
return match;
}
@@ -1126,7 +1130,7 @@ void OmniboxEditModel::OnCurrentMatchChanged(bool is_temporary_set_by_instant) {
has_temporary_text_ = is_temporary_set_by_instant;
is_temporary_text_set_by_instant_ = is_temporary_set_by_instant;
- const AutocompleteMatch& match = omnibox_controller_->CurrentMatch(NULL);
+ const AutocompleteMatch& match = omnibox_controller_->current_match();
if (is_temporary_set_by_instant) {
view_->OnTemporaryTextMaybeChanged(
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698