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

Side by Side Diff: ui/views/controls/textfield/native_textfield_win.cc

Issue 15841009: Delays find-in-page until IME composition is committed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/textfield/native_textfield_win.h" 5 #include "ui/views/controls/textfield/native_textfield_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 if (!clipboard_str.empty()) { 1056 if (!clipboard_str.empty()) {
1057 string16 collapsed(CollapseWhitespace(clipboard_str, false)); 1057 string16 collapsed(CollapseWhitespace(clipboard_str, false));
1058 if (textfield_->style() & Textfield::STYLE_LOWERCASE) 1058 if (textfield_->style() & Textfield::STYLE_LOWERCASE)
1059 collapsed = base::i18n::ToLower(collapsed); 1059 collapsed = base::i18n::ToLower(collapsed);
1060 // Force a Paste operation to trigger ContentsChanged, even if identical 1060 // Force a Paste operation to trigger ContentsChanged, even if identical
1061 // contents are pasted into the text box. See http://crbug.com/79002 1061 // contents are pasted into the text box. See http://crbug.com/79002
1062 ReplaceSel(L"", false); 1062 ReplaceSel(L"", false);
1063 textfield_->SyncText(); 1063 textfield_->SyncText();
1064 text_before_change_.clear(); 1064 text_before_change_.clear();
1065 ReplaceSel(collapsed.c_str(), true); 1065 ReplaceSel(collapsed.c_str(), true);
1066 if (TextfieldController* controller = textfield_->GetController())
1067 controller->OnAfterPaste();
1066 } 1068 }
1067 } 1069 }
1068 1070
1069 void NativeTextfieldWin::OnSetFocus(HWND hwnd) { 1071 void NativeTextfieldWin::OnSetFocus(HWND hwnd) {
1070 SetMsgHandled(FALSE); // We still want the default processing of the message. 1072 SetMsgHandled(FALSE); // We still want the default processing of the message.
1071 1073
1072 views::FocusManager* focus_manager = textfield_->GetFocusManager(); 1074 views::FocusManager* focus_manager = textfield_->GetFocusManager();
1073 if (!focus_manager) { 1075 if (!focus_manager) {
1074 NOTREACHED(); 1076 NOTREACHED();
1075 return; 1077 return;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 return true; 1311 return true;
1310 MSG msg(*GetCurrentMessage()); 1312 MSG msg(*GetCurrentMessage());
1311 // ATL doesn't set the |time| field. 1313 // ATL doesn't set the |time| field.
1312 if (!msg.time) 1314 if (!msg.time)
1313 msg.time = GetMessageTime(); 1315 msg.time = GetMessageTime();
1314 ui::MouseEvent mouse_event(msg); 1316 ui::MouseEvent mouse_event(msg);
1315 return !controller->HandleMouseEvent(textfield_, mouse_event); 1317 return !controller->HandleMouseEvent(textfield_, mouse_event);
1316 } 1318 }
1317 1319
1318 } // namespace views 1320 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views.cc ('k') | ui/views/controls/textfield/textfield_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698