| 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(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "views/widget/widget.h" | 23 #include "views/widget/widget.h" |
| 24 | 24 |
| 25 #if defined(OS_LINUX) | 25 #if defined(OS_LINUX) |
| 26 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" | 26 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" |
| 27 #elif defined(OS_WIN) | 27 #elif defined(OS_WIN) |
| 28 #include "base/win/win_util.h" | 28 #include "base/win/win_util.h" |
| 29 // TODO(beng): this should be removed when the OS_WIN hack from | 29 // TODO(beng): this should be removed when the OS_WIN hack from |
| 30 // ViewHierarchyChanged is removed. | 30 // ViewHierarchyChanged is removed. |
| 31 #include "views/controls/textfield/native_textfield_views.h" | 31 #include "views/controls/textfield/native_textfield_views.h" |
| 32 #include "views/controls/textfield/native_textfield_win.h" | 32 #include "views/controls/textfield/native_textfield_win.h" |
| 33 #include "views/events/event_utils_win.h" | |
| 34 #endif | 33 #endif |
| 35 | 34 |
| 36 namespace views { | 35 namespace views { |
| 37 | 36 |
| 38 // static | 37 // static |
| 39 const char Textfield::kViewClassName[] = "views/Textfield"; | 38 const char Textfield::kViewClassName[] = "views/Textfield"; |
| 40 | 39 |
| 41 ///////////////////////////////////////////////////////////////////////////// | 40 ///////////////////////////////////////////////////////////////////////////// |
| 42 // Textfield | 41 // Textfield |
| 43 | 42 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 ui::KeyboardCode key = e.key_code(); | 333 ui::KeyboardCode key = e.key_code(); |
| 335 if (key == ui::VKEY_BACK) | 334 if (key == ui::VKEY_BACK) |
| 336 return true; // We'll handle BackSpace ourselves. | 335 return true; // We'll handle BackSpace ourselves. |
| 337 | 336 |
| 338 #if defined(USE_AURA) | 337 #if defined(USE_AURA) |
| 339 NOTIMPLEMENTED(); | 338 NOTIMPLEMENTED(); |
| 340 #elif defined(OS_WIN) | 339 #elif defined(OS_WIN) |
| 341 // We don't translate accelerators for ALT + NumPad digit on Windows, they are | 340 // We don't translate accelerators for ALT + NumPad digit on Windows, they are |
| 342 // used for entering special characters. We do translate alt-home. | 341 // used for entering special characters. We do translate alt-home. |
| 343 if (e.IsAltDown() && (key != ui::VKEY_HOME) && | 342 if (e.IsAltDown() && (key != ui::VKEY_HOME) && |
| 344 NativeTextfieldWin::IsNumPadDigit(key, IsExtendedKey(e))) | 343 NativeTextfieldWin::IsNumPadDigit(key, |
| 344 (e.flags() & ui::EF_EXTENDED) != 0)) |
| 345 return true; | 345 return true; |
| 346 #endif | 346 #endif |
| 347 return false; | 347 return false; |
| 348 } | 348 } |
| 349 | 349 |
| 350 void Textfield::OnPaintBackground(gfx::Canvas* canvas) { | 350 void Textfield::OnPaintBackground(gfx::Canvas* canvas) { |
| 351 // Overridden to be public - gtk_views_entry.cc wants to call it. | 351 // Overridden to be public - gtk_views_entry.cc wants to call it. |
| 352 View::OnPaintBackground(canvas); | 352 View::OnPaintBackground(canvas); |
| 353 } | 353 } |
| 354 | 354 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 } | 433 } |
| 434 #endif | 434 #endif |
| 435 } | 435 } |
| 436 } | 436 } |
| 437 | 437 |
| 438 std::string Textfield::GetClassName() const { | 438 std::string Textfield::GetClassName() const { |
| 439 return kViewClassName; | 439 return kViewClassName; |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace views | 442 } // namespace views |
| OLD | NEW |