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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_view_win.cc

Issue 505026: Use KF_ALTDOWN flag instead of GetKeyState(VK_MENU) (Closed)
Patch Set: Created 11 years 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
« no previous file with comments | « no previous file | 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 "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/clipboard/clipboard.h" 9 #include "app/clipboard/clipboard.h"
10 #include "app/clipboard/scoped_clipboard_writer.h" 10 #include "app/clipboard/scoped_clipboard_writer.h"
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 if (key == VK_CONTROL) 1312 if (key == VK_CONTROL)
1313 model_->OnControlKeyChanged(false); 1313 model_->OnControlKeyChanged(false);
1314 1314
1315 // On systems with RTL input languages, ctrl+shift toggles the reading order 1315 // On systems with RTL input languages, ctrl+shift toggles the reading order
1316 // (depending on which shift key is pressed). But by default the CRichEditCtrl 1316 // (depending on which shift key is pressed). But by default the CRichEditCtrl
1317 // only changes the current reading order, and as soon as the user deletes all 1317 // only changes the current reading order, and as soon as the user deletes all
1318 // the text, or we call SetWindowText(), it reverts to the "default" order. 1318 // the text, or we call SetWindowText(), it reverts to the "default" order.
1319 // To work around this, if the user hits ctrl+shift, we pass it to 1319 // To work around this, if the user hits ctrl+shift, we pass it to
1320 // DefWindowProc() while the edit is empty, which toggles the default reading 1320 // DefWindowProc() while the edit is empty, which toggles the default reading
1321 // order; then we restore the user's input. 1321 // order; then we restore the user's input.
1322 if ((GetKeyState(VK_MENU) == 0) && 1322 if (!(flags & KF_ALTDOWN) &&
1323 (((key == VK_CONTROL) && (GetKeyState(VK_SHIFT) < 0)) || 1323 (((key == VK_CONTROL) && (GetKeyState(VK_SHIFT) < 0)) ||
1324 ((key == VK_SHIFT) && (GetKeyState(VK_CONTROL) < 0)))) { 1324 ((key == VK_SHIFT) && (GetKeyState(VK_CONTROL) < 0)))) {
1325 ScopedFreeze freeze(this, GetTextObjectModel()); 1325 ScopedFreeze freeze(this, GetTextObjectModel());
1326 1326
1327 std::wstring saved_text(GetText()); 1327 std::wstring saved_text(GetText());
1328 CHARRANGE saved_sel; 1328 CHARRANGE saved_sel;
1329 GetSelection(saved_sel); 1329 GetSelection(saved_sel);
1330 1330
1331 SetWindowText(L""); 1331 SetWindowText(L"");
1332 1332
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
2423 context_menu_contents_->AddItemWithStringId(IDS_PASTE_AND_GO, 2423 context_menu_contents_->AddItemWithStringId(IDS_PASTE_AND_GO,
2424 IDS_PASTE_AND_GO); 2424 IDS_PASTE_AND_GO);
2425 context_menu_contents_->AddSeparator(); 2425 context_menu_contents_->AddSeparator();
2426 context_menu_contents_->AddItemWithStringId(IDS_SELECT_ALL, IDS_SELECT_ALL); 2426 context_menu_contents_->AddItemWithStringId(IDS_SELECT_ALL, IDS_SELECT_ALL);
2427 context_menu_contents_->AddSeparator(); 2427 context_menu_contents_->AddSeparator();
2428 context_menu_contents_->AddItemWithStringId(IDS_EDIT_SEARCH_ENGINES, 2428 context_menu_contents_->AddItemWithStringId(IDS_EDIT_SEARCH_ENGINES,
2429 IDS_EDIT_SEARCH_ENGINES); 2429 IDS_EDIT_SEARCH_ENGINES);
2430 } 2430 }
2431 context_menu_.reset(new views::Menu2(context_menu_contents_.get())); 2431 context_menu_.reset(new views::Menu2(context_menu_contents_.get()));
2432 } 2432 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698