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

Unified Diff: chrome/browser/ui/gtk/location_bar_view_gtk.cc

Issue 5966006: Hitting Tab should always move cursor to end of omnibox text. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Mac build. Created 9 years, 11 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/gtk/location_bar_view_gtk.cc
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
index 6b600d472413e2ef501e21dda9d9fccad2a0ab4d..b7a5c72f52f1cdff2bb8a4318771b1341d2520c5 100644
--- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
@@ -458,9 +458,17 @@ void LocationBarViewGtk::OnAutocompleteWillAccept() {
update_instant_ = false;
}
-bool LocationBarViewGtk::OnCommitSuggestedText(
- const string16& typed_text) {
- return browser_->instant() && location_entry_->CommitInstantSuggestion();
+bool LocationBarViewGtk::OnCommitSuggestedText(bool skip_inline_autocomplete) {
+ if (!browser_->instant())
+ return false;
+
+ const string16 suggestion = location_entry_->GetInstantSuggestion();
+ if (suggestion.empty())
+ return false;
+
+ location_entry_->model()->FinalizeInstantQuery(
+ location_entry_->GetText(), suggestion, skip_inline_autocomplete);
+ return true;
}
bool LocationBarViewGtk::AcceptCurrentInstantPreview() {
@@ -538,13 +546,13 @@ void LocationBarViewGtk::OnChanged() {
location_entry_->model()->UseVerbatimInstant(),
&suggested_text);
if (!instant->MightSupportInstant()) {
- location_entry_->model()->FinalizeInstantQuery(string16(),
- string16());
+ location_entry_->model()->FinalizeInstantQuery(
+ string16(), string16(), false);
}
} else {
instant->DestroyPreviewContents();
- location_entry_->model()->FinalizeInstantQuery(string16(),
- string16());
+ location_entry_->model()->FinalizeInstantQuery(
+ string16(), string16(), false);
}
}
@@ -627,7 +635,7 @@ void LocationBarViewGtk::SetSuggestedText(const string16& text) {
// text.
if (!text.empty()) {
location_entry_->model()->FinalizeInstantQuery(
- location_entry_->GetText(), text);
+ location_entry_->GetText(), text, false);
}
} else {
location_entry_->SetInstantSuggestion(text);
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.h ('k') | chrome/browser/ui/views/location_bar/location_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698