| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <locale> | 8 #include <locale> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 return host; | 962 return host; |
| 963 } | 963 } |
| 964 | 964 |
| 965 void AutocompleteEditViewWin::PasteAndGo(const string16& text) { | 965 void AutocompleteEditViewWin::PasteAndGo(const string16& text) { |
| 966 if (CanPasteAndGo(text)) | 966 if (CanPasteAndGo(text)) |
| 967 model_->PasteAndGo(); | 967 model_->PasteAndGo(); |
| 968 } | 968 } |
| 969 | 969 |
| 970 bool AutocompleteEditViewWin::SkipDefaultKeyEventProcessing( | 970 bool AutocompleteEditViewWin::SkipDefaultKeyEventProcessing( |
| 971 const views::KeyEvent& e) { | 971 const views::KeyEvent& e) { |
| 972 ui::KeyboardCode key = e.GetKeyCode(); | 972 ui::KeyboardCode key = e.key_code(); |
| 973 // We don't process ALT + numpad digit as accelerators, they are used for | 973 // We don't process ALT + numpad digit as accelerators, they are used for |
| 974 // entering special characters. We do translate alt-home. | 974 // entering special characters. We do translate alt-home. |
| 975 if (e.IsAltDown() && (key != ui::VKEY_HOME) && | 975 if (e.IsAltDown() && (key != ui::VKEY_HOME) && |
| 976 views::NativeTextfieldWin::IsNumPadDigit(key, e.IsExtendedKey())) | 976 views::NativeTextfieldWin::IsNumPadDigit(key, e.IsExtendedKey())) |
| 977 return true; | 977 return true; |
| 978 | 978 |
| 979 // Skip accelerators for key combinations omnibox wants to crack. This list | 979 // Skip accelerators for key combinations omnibox wants to crack. This list |
| 980 // should be synced with OnKeyDownOnlyWritable() (but for tab which is dealt | 980 // should be synced with OnKeyDownOnlyWritable() (but for tab which is dealt |
| 981 // with above in LocationBarView::SkipDefaultKeyEventProcessing). | 981 // with above in LocationBarView::SkipDefaultKeyEventProcessing). |
| 982 // | 982 // |
| (...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2582 // PosFromChar(i) might return 0 when i is greater than 1. | 2582 // PosFromChar(i) might return 0 when i is greater than 1. |
| 2583 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2583 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
| 2584 } | 2584 } |
| 2585 | 2585 |
| 2586 bool AutocompleteEditViewWin::IsCaretAtEnd() const { | 2586 bool AutocompleteEditViewWin::IsCaretAtEnd() const { |
| 2587 long length = GetTextLength(); | 2587 long length = GetTextLength(); |
| 2588 CHARRANGE sel; | 2588 CHARRANGE sel; |
| 2589 GetSelection(sel); | 2589 GetSelection(sel); |
| 2590 return sel.cpMin == sel.cpMax && sel.cpMin == length; | 2590 return sel.cpMin == sel.cpMax && sel.cpMin == length; |
| 2591 } | 2591 } |
| OLD | NEW |