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

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

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/cocoa/location_bar/location_bar_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
index 213cc53e0a0354b09d8a36eb1a5dfd2e53c6f6d6..ba43a7c7709d60f72481fe17aa2c4961b81d6bdf 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -248,8 +248,17 @@ void LocationBarViewMac::OnAutocompleteWillAccept() {
update_instant_ = false;
}
-bool LocationBarViewMac::OnCommitSuggestedText(const string16& typed_text) {
- return edit_view_->CommitSuggestText();
+bool LocationBarViewMac::OnCommitSuggestedText(bool skip_inline_autocomplete) {
+ if (!browser_->instant())
+ return false;
+
+ const string16 suggestion = edit_view_->GetInstantSuggestion();
+ if (suggestion.empty())
+ return false;
+
+ edit_view_->model()->FinalizeInstantQuery(
+ edit_view_->GetText(), suggestion, skip_inline_autocomplete);
+ return true;
}
bool LocationBarViewMac::AcceptCurrentInstantPreview() {
@@ -321,13 +330,13 @@ void LocationBarViewMac::OnChanged() {
edit_view_->model()->UseVerbatimInstant(),
&suggested_text);
if (!instant->MightSupportInstant()) {
- edit_view_->model()->FinalizeInstantQuery(string16(),
- string16());
+ edit_view_->model()->FinalizeInstantQuery(
+ string16(), string16(), false);
}
} else {
instant->DestroyPreviewContents();
- edit_view_->model()->FinalizeInstantQuery(string16(),
- string16());
+ edit_view_->model()->FinalizeInstantQuery(
+ string16(), string16(), false);
}
}
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h ('k') | chrome/browser/ui/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698