OLD | NEW |
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_win.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <locale> | 8 #include <locale> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 void OmniboxViewWin::PasteAndGo(const string16& text) { | 1050 void OmniboxViewWin::PasteAndGo(const string16& text) { |
1051 if (CanPasteAndGo(text)) | 1051 if (CanPasteAndGo(text)) |
1052 model_->PasteAndGo(); | 1052 model_->PasteAndGo(); |
1053 } | 1053 } |
1054 | 1054 |
1055 bool OmniboxViewWin::SkipDefaultKeyEventProcessing( | 1055 bool OmniboxViewWin::SkipDefaultKeyEventProcessing( |
1056 const views::KeyEvent& event) { | 1056 const views::KeyEvent& event) { |
1057 ui::KeyboardCode key = event.key_code(); | 1057 ui::KeyboardCode key = event.key_code(); |
1058 // We don't process ALT + numpad digit as accelerators, they are used for | 1058 // We don't process ALT + numpad digit as accelerators, they are used for |
1059 // entering special characters. We do translate alt-home. | 1059 // entering special characters. We do translate alt-home. |
1060 if (event.IsAltDown() && (key != ui::VKEY_HOME) && | 1060 if (event.IsAltDown() && (key != ui::VKEY_HOME) && event.IsNumPadDigit()) |
1061 views::NativeTextfieldWin::IsNumPadDigit(key, | |
1062 (event.flags() & ui::EF_EXTENDED) != 0)) | |
1063 return true; | 1061 return true; |
1064 | 1062 |
1065 // Skip accelerators for key combinations omnibox wants to crack. This list | 1063 // Skip accelerators for key combinations omnibox wants to crack. This list |
1066 // should be synced with OnKeyDownOnlyWritable() (but for tab which is dealt | 1064 // should be synced with OnKeyDownOnlyWritable() (but for tab which is dealt |
1067 // with above in LocationBarView::SkipDefaultKeyEventProcessing). | 1065 // with above in LocationBarView::SkipDefaultKeyEventProcessing). |
1068 // | 1066 // |
1069 // We cannot return true for all keys because we still need to handle some | 1067 // We cannot return true for all keys because we still need to handle some |
1070 // accelerators (e.g., F5 for reload the page should work even when the | 1068 // accelerators (e.g., F5 for reload the page should work even when the |
1071 // Omnibox gets focused). | 1069 // Omnibox gets focused). |
1072 switch (key) { | 1070 switch (key) { |
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2704 bool popup_window_mode, | 2702 bool popup_window_mode, |
2705 LocationBarView* location_bar) { | 2703 LocationBarView* location_bar) { |
2706 return new OmniboxViewWin(controller, | 2704 return new OmniboxViewWin(controller, |
2707 toolbar_model, | 2705 toolbar_model, |
2708 location_bar, | 2706 location_bar, |
2709 command_updater, | 2707 command_updater, |
2710 popup_window_mode, | 2708 popup_window_mode, |
2711 location_bar); | 2709 location_bar); |
2712 } | 2710 } |
2713 #endif | 2711 #endif |
OLD | NEW |