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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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
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 "chrome/browser/ui/views/omnibox/omnibox_view_views.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 // Skip processing of [Alt]+<num-pad digit> Unicode alt key codes. 896 // Skip processing of [Alt]+<num-pad digit> Unicode alt key codes.
897 // Otherwise, if num-lock is off, the events are handled as [Up], [Down], etc. 897 // Otherwise, if num-lock is off, the events are handled as [Up], [Down], etc.
898 if (event.IsUnicodeKeyCode()) 898 if (event.IsUnicodeKeyCode())
899 return false; 899 return false;
900 900
901 const bool shift = event.IsShiftDown(); 901 const bool shift = event.IsShiftDown();
902 const bool control = event.IsControlDown(); 902 const bool control = event.IsControlDown();
903 const bool alt = event.IsAltDown() || event.IsAltGrDown(); 903 const bool alt = event.IsAltDown() || event.IsAltGrDown();
904 switch (event.key_code()) { 904 switch (event.key_code()) {
905 case ui::VKEY_RETURN: 905 case ui::VKEY_RETURN:
906 model()->AcceptInput(alt ? NEW_FOREGROUND_TAB : CURRENT_TAB, false); 906 model()->AcceptInput(alt ? WindowOpenDisposition::NEW_FOREGROUND_TAB
907 : WindowOpenDisposition::CURRENT_TAB,
908 false);
907 return true; 909 return true;
908 case ui::VKEY_ESCAPE: 910 case ui::VKEY_ESCAPE:
909 return model()->OnEscapeKeyPressed(); 911 return model()->OnEscapeKeyPressed();
910 case ui::VKEY_CONTROL: 912 case ui::VKEY_CONTROL:
911 model()->OnControlKeyChanged(true); 913 model()->OnControlKeyChanged(true);
912 break; 914 break;
913 case ui::VKEY_DELETE: 915 case ui::VKEY_DELETE:
914 if (shift && model()->popup_model()->IsOpen()) 916 if (shift && model()->popup_model()->IsOpen())
915 model()->popup_model()->TryDeletingCurrentItem(); 917 model()->popup_model()->TryDeletingCurrentItem();
916 918
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO); 1086 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO);
1085 1087
1086 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR); 1088 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR);
1087 1089
1088 // Minor note: We use IDC_ for command id here while the underlying textfield 1090 // Minor note: We use IDC_ for command id here while the underlying textfield
1089 // is using IDS_ for all its command ids. This is because views cannot depend 1091 // is using IDS_ for all its command ids. This is because views cannot depend
1090 // on IDC_ for now. 1092 // on IDC_ for now.
1091 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, 1093 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES,
1092 IDS_EDIT_SEARCH_ENGINES); 1094 IDS_EDIT_SEARCH_ENGINES);
1093 } 1095 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698