OLD | NEW |
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 "chrome/browser/autocomplete/autocomplete_edit_view_win.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" |
6 | 6 |
7 #include <locale> | 7 #include <locale> |
8 | 8 |
9 #include "app/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 return false; | 1722 return false; |
1723 if (GetKeyState(VK_SHIFT) >= 0) { | 1723 if (GetKeyState(VK_SHIFT) >= 0) { |
1724 ScopedFreeze freeze(this, GetTextObjectModel()); | 1724 ScopedFreeze freeze(this, GetTextObjectModel()); |
1725 OnBeforePossibleChange(); | 1725 OnBeforePossibleChange(); |
1726 Cut(); | 1726 Cut(); |
1727 OnAfterPossibleChange(); | 1727 OnAfterPossibleChange(); |
1728 } | 1728 } |
1729 return true; | 1729 return true; |
1730 | 1730 |
1731 case VK_INSERT: | 1731 case VK_INSERT: |
| 1732 // Ignore insert by itself, so we don't turn overtype mode on/off. |
| 1733 if (!(flags & KF_ALTDOWN) && (GetKeyState(VK_SHIFT) >= 0) && |
| 1734 (GetKeyState(VK_CONTROL) >= 0)) |
| 1735 return true; |
| 1736 // FALL THROUGH |
1732 case 'V': | 1737 case 'V': |
1733 if ((flags & KF_ALTDOWN) || | 1738 if ((flags & KF_ALTDOWN) || |
1734 (GetKeyState((key == 'V') ? VK_CONTROL : VK_SHIFT) >= 0)) | 1739 (GetKeyState((key == 'V') ? VK_CONTROL : VK_SHIFT) >= 0)) |
1735 return false; | 1740 return false; |
1736 if (GetKeyState((key == 'V') ? VK_SHIFT : VK_CONTROL) >= 0) { | 1741 if (GetKeyState((key == 'V') ? VK_SHIFT : VK_CONTROL) >= 0) { |
1737 ScopedFreeze freeze(this, GetTextObjectModel()); | 1742 ScopedFreeze freeze(this, GetTextObjectModel()); |
1738 OnBeforePossibleChange(); | 1743 OnBeforePossibleChange(); |
1739 Paste(); | 1744 Paste(); |
1740 OnAfterPossibleChange(); | 1745 OnAfterPossibleChange(); |
1741 } | 1746 } |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2263 } | 2268 } |
2264 | 2269 |
2265 void AutocompleteEditViewWin::RepaintDropHighlight(int position) { | 2270 void AutocompleteEditViewWin::RepaintDropHighlight(int position) { |
2266 if ((position != -1) && (position <= GetTextLength())) { | 2271 if ((position != -1) && (position <= GetTextLength())) { |
2267 const POINT min_loc(PosFromChar(position)); | 2272 const POINT min_loc(PosFromChar(position)); |
2268 const RECT highlight_bounds = {min_loc.x - 1, font_y_adjustment_, | 2273 const RECT highlight_bounds = {min_loc.x - 1, font_y_adjustment_, |
2269 min_loc.x + 2, font_ascent_ + font_descent_ + font_y_adjustment_}; | 2274 min_loc.x + 2, font_ascent_ + font_descent_ + font_y_adjustment_}; |
2270 InvalidateRect(&highlight_bounds, false); | 2275 InvalidateRect(&highlight_bounds, false); |
2271 } | 2276 } |
2272 } | 2277 } |
OLD | NEW |