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

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

Issue 115934: Ignore the insert key so we don't switch into overtype mode (which surprises ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "app/l10n_util.h" 5 #include "app/l10n_util.h"
6 #include "app/l10n_util_win.h" 6 #include "app/l10n_util_win.h"
7 #include "app/win_util.h" 7 #include "app/win_util.h"
8 #include "base/clipboard.h" 8 #include "base/clipboard.h"
9 #include "base/gfx/native_theme.h" 9 #include "base/gfx/native_theme.h"
10 #include "base/scoped_clipboard_writer.h" 10 #include "base/scoped_clipboard_writer.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 return; 413 return;
414 414
415 case 'C': 415 case 'C':
416 if ((flags & KF_ALTDOWN) || (GetKeyState(VK_CONTROL) >= 0)) 416 if ((flags & KF_ALTDOWN) || (GetKeyState(VK_CONTROL) >= 0))
417 break; 417 break;
418 if (GetKeyState(VK_SHIFT) >= 0) 418 if (GetKeyState(VK_SHIFT) >= 0)
419 Copy(); 419 Copy();
420 return; 420 return;
421 421
422 case VK_INSERT: 422 case VK_INSERT:
423 // Ignore insert by itself, so we don't turn overtype mode on/off.
424 if (!(flags & KF_ALTDOWN) && (GetKeyState(VK_SHIFT) >= 0) &&
425 (GetKeyState(VK_CONTROL) >= 0))
426 return;
Finnur 2011/03/25 14:44:00 Peter, did you mean to add a break statement here
Peter Kasting 2011/03/25 19:25:12 The latter. Shift-insert == ctrl-v. See also how
Finnur 2011/03/25 19:27:57 Excellent. I guess I'll add a comment here for fut
423 case 'V': 427 case 'V':
424 if ((flags & KF_ALTDOWN) || 428 if ((flags & KF_ALTDOWN) ||
425 (GetKeyState((key == 'V') ? VK_CONTROL : VK_SHIFT) >= 0)) 429 (GetKeyState((key == 'V') ? VK_CONTROL : VK_SHIFT) >= 0))
426 break; 430 break;
427 if (GetKeyState((key == 'V') ? VK_SHIFT : VK_CONTROL) >= 0) { 431 if (GetKeyState((key == 'V') ? VK_SHIFT : VK_CONTROL) >= 0) {
428 ScopedFreeze freeze(this, GetTextObjectModel()); 432 ScopedFreeze freeze(this, GetTextObjectModel());
429 OnBeforePossibleChange(); 433 OnBeforePossibleChange();
430 Paste(); 434 Paste();
431 OnAfterPossibleChange(); 435 OnAfterPossibleChange();
432 } 436 }
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 //////////////////////////////////////////////////////////////////////////////// 827 ////////////////////////////////////////////////////////////////////////////////
824 // NativeTextfieldWrapper, public: 828 // NativeTextfieldWrapper, public:
825 829
826 // static 830 // static
827 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 831 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
828 Textfield* field) { 832 Textfield* field) {
829 return new NativeTextfieldWin(field); 833 return new NativeTextfieldWin(field);
830 } 834 }
831 835
832 } // namespace views 836 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698