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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_win.cc

Issue 6252003: Accept keyword by pressing space. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only allow 0x0020 and 0x3000 for now. 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/autocomplete/autocomplete_edit_view_win.cc
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
index bdc978f16a5d661fdcc2671d0462eb890ae88adb..9e2a8206cccd3dd0bc999371f9d06ed95120ab06 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
@@ -861,8 +861,11 @@ bool AutocompleteEditViewWin::OnAfterPossibleChangeInternal(
new_sel.cpMax = length;
SetSelectionRange(new_sel);
}
- const bool selection_differs = (new_sel.cpMin != sel_before_change_.cpMin) ||
- (new_sel.cpMax != sel_before_change_.cpMax);
+ const bool selection_differs =
+ ((new_sel.cpMin != new_sel.cpMax) ||
+ (sel_before_change_.cpMin != sel_before_change_.cpMax)) &&
+ ((new_sel.cpMin != sel_before_change_.cpMin) ||
+ (new_sel.cpMax != sel_before_change_.cpMax));
const bool at_end_of_edit =
(new_sel.cpMin == length) && (new_sel.cpMax == length);
@@ -1690,10 +1693,8 @@ void AutocompleteEditViewWin::OnPaste() {
// Replace the selection if we have something to paste.
const std::wstring text(GetClipboardText());
if (!text.empty()) {
- // If this paste will be replacing all the text, record that, so we can do
- // different behaviors in such a case.
- if (IsSelectAll())
- model_->on_paste_replacing_all();
+ // Record this paste, so we can do different behavior.
+ model_->on_paste();
// Force a Paste operation to trigger the text_changed code in
// OnAfterPossibleChange(), even if identical contents are pasted into the
// text box.
@@ -1972,7 +1973,7 @@ bool AutocompleteEditViewWin::OnKeyDownOnlyWritable(TCHAR key,
}
case VK_TAB: {
- if (model_->is_keyword_hint() && !model_->keyword().empty()) {
+ if (model_->is_keyword_hint()) {
// Accept the keyword.
ScopedFreeze freeze(this, GetTextObjectModel());
model_->AcceptKeyword();
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_mac.mm ('k') | chrome/browser/ui/gtk/location_bar_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698