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

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: 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
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..a08834e172adb28a8ea690723c2a04be69a27a03 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -187,10 +187,16 @@ 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()) {
Peter Kasting 2013/06/18 23:31:19 Nit: Less indenting: if (!match.destination_url
beaudoin 2013/06/19 18:21:10 Done.
+ if (alternate_nav_url) {
+ *alternate_nav_url = AutocompleteResult::ComputeAlternateNavUrl(
+ autocomplete_controller()->input(), match);
+ }
+ } else {
GetInfoForCurrentText(&match, alternate_nav_url);
+ }
return match;
}
@@ -1126,7 +1132,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(

Powered by Google App Engine
This is Rietveld 408576698