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

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

Issue 6480001: Migrate Event API methods to Google Style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698