Chromium Code Reviews| 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 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1810 return false; | 1810 return false; |
| 1811 if (GetKeyState((key == 'V') ? VK_SHIFT : VK_CONTROL) >= 0) { | 1811 if (GetKeyState((key == 'V') ? VK_SHIFT : VK_CONTROL) >= 0) { |
| 1812 ScopedFreeze freeze(this, GetTextObjectModel()); | 1812 ScopedFreeze freeze(this, GetTextObjectModel()); |
| 1813 OnBeforePossibleChange(); | 1813 OnBeforePossibleChange(); |
| 1814 Paste(); | 1814 Paste(); |
| 1815 OnAfterPossibleChange(); | 1815 OnAfterPossibleChange(); |
| 1816 } | 1816 } |
| 1817 return true; | 1817 return true; |
| 1818 | 1818 |
| 1819 case VK_BACK: { | 1819 case VK_BACK: { |
| 1820 // On Ctrl+Backspace, the default Windows behavior is to delete the | |
| 1821 // previous word, however this leaves behind the inline autocomplete | |
| 1822 // suggestion text. Here we clear the suggestion text and place the caret | |
| 1823 // at the end of the user typed text. | |
| 1824 if (GetKeyState(VK_CONTROL) < 0) | |
|
Peter Kasting
2009/08/16 21:59:04
This approach isn't right.
First, you need to hav
| |
| 1825 SetWindowTextAndCaretPos(model_->user_text(), | |
| 1826 model_->user_text().length()); | |
| 1820 if ((flags & KF_ALTDOWN) || model_->is_keyword_hint() || | 1827 if ((flags & KF_ALTDOWN) || model_->is_keyword_hint() || |
| 1821 model_->keyword().empty()) | 1828 model_->keyword().empty()) |
| 1822 return false; | 1829 return false; |
| 1823 | 1830 |
| 1824 { | 1831 { |
| 1825 CHARRANGE selection; | 1832 CHARRANGE selection; |
| 1826 GetSel(selection); | 1833 GetSel(selection); |
| 1827 if ((selection.cpMin != selection.cpMax) || (selection.cpMin != 0)) | 1834 if ((selection.cpMin != selection.cpMax) || (selection.cpMin != 0)) |
| 1828 return false; | 1835 return false; |
| 1829 } | 1836 } |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2367 context_menu_contents_->AddItemWithStringId(IDS_PASTE_AND_GO, | 2374 context_menu_contents_->AddItemWithStringId(IDS_PASTE_AND_GO, |
| 2368 IDS_PASTE_AND_GO); | 2375 IDS_PASTE_AND_GO); |
| 2369 context_menu_contents_->AddSeparator(); | 2376 context_menu_contents_->AddSeparator(); |
| 2370 context_menu_contents_->AddItemWithStringId(IDS_SELECT_ALL, IDS_SELECT_ALL); | 2377 context_menu_contents_->AddItemWithStringId(IDS_SELECT_ALL, IDS_SELECT_ALL); |
| 2371 context_menu_contents_->AddSeparator(); | 2378 context_menu_contents_->AddSeparator(); |
| 2372 context_menu_contents_->AddItemWithStringId(IDS_EDIT_SEARCH_ENGINES, | 2379 context_menu_contents_->AddItemWithStringId(IDS_EDIT_SEARCH_ENGINES, |
| 2373 IDS_EDIT_SEARCH_ENGINES); | 2380 IDS_EDIT_SEARCH_ENGINES); |
| 2374 } | 2381 } |
| 2375 context_menu_.reset(new views::Menu2(context_menu_contents_.get())); | 2382 context_menu_.reset(new views::Menu2(context_menu_contents_.get())); |
| 2376 } | 2383 } |
| OLD | NEW |