| 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 "views/controls/textfield/textfield.h" | 5 #include "views/controls/textfield/textfield.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 return View::IsFocusable() && !read_only_; | 302 return View::IsFocusable() && !read_only_; |
| 303 } | 303 } |
| 304 | 304 |
| 305 void Textfield::AboutToRequestFocusFromTabTraversal(bool reverse) { | 305 void Textfield::AboutToRequestFocusFromTabTraversal(bool reverse) { |
| 306 SelectAll(); | 306 SelectAll(); |
| 307 } | 307 } |
| 308 | 308 |
| 309 bool Textfield::SkipDefaultKeyEventProcessing(const KeyEvent& e) { | 309 bool Textfield::SkipDefaultKeyEventProcessing(const KeyEvent& e) { |
| 310 // TODO(hamaji): Figure out which keyboard combinations we need to add here, | 310 // TODO(hamaji): Figure out which keyboard combinations we need to add here, |
| 311 // similar to LocationBarView::SkipDefaultKeyEventProcessing. | 311 // similar to LocationBarView::SkipDefaultKeyEventProcessing. |
| 312 ui::KeyboardCode key = e.GetKeyCode(); | 312 ui::KeyboardCode key = e.key_code(); |
| 313 if (key == ui::VKEY_BACK) | 313 if (key == ui::VKEY_BACK) |
| 314 return true; // We'll handle BackSpace ourselves. | 314 return true; // We'll handle BackSpace ourselves. |
| 315 | 315 |
| 316 #if defined(OS_WIN) | 316 #if defined(OS_WIN) |
| 317 // We don't translate accelerators for ALT + NumPad digit on Windows, they are | 317 // We don't translate accelerators for ALT + NumPad digit on Windows, they are |
| 318 // used for entering special characters. We do translate alt-home. | 318 // used for entering special characters. We do translate alt-home. |
| 319 if (e.IsAltDown() && (key != ui::VKEY_HOME) && | 319 if (e.IsAltDown() && (key != ui::VKEY_HOME) && |
| 320 NativeTextfieldWin::IsNumPadDigit(key, e.IsExtendedKey())) | 320 NativeTextfieldWin::IsNumPadDigit(key, e.IsExtendedKey())) |
| 321 return true; | 321 return true; |
| 322 #endif | 322 #endif |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 } | 410 } |
| 411 #endif | 411 #endif |
| 412 } | 412 } |
| 413 } | 413 } |
| 414 | 414 |
| 415 std::string Textfield::GetClassName() const { | 415 std::string Textfield::GetClassName() const { |
| 416 return kViewClassName; | 416 return kViewClassName; |
| 417 } | 417 } |
| 418 | 418 |
| 419 } // namespace views | 419 } // namespace views |
| OLD | NEW |