OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 // Remove the include for native_textfield_win.h above when you fix this. | 347 // Remove the include for native_textfield_win.h above when you fix this. |
348 static_cast<NativeTextfieldWin*>(native_wrapper_)->AttachHack(); | 348 static_cast<NativeTextfieldWin*>(native_wrapper_)->AttachHack(); |
349 #endif | 349 #endif |
350 } | 350 } |
351 } | 351 } |
352 | 352 |
353 std::string Textfield::GetClassName() const { | 353 std::string Textfield::GetClassName() const { |
354 return kViewClassName; | 354 return kViewClassName; |
355 } | 355 } |
356 | 356 |
357 app::KeyboardCode Textfield::Keystroke::GetKeyboardCode() const { | |
358 #if defined(OS_WIN) | |
359 return static_cast<app::KeyboardCode>(key_); | |
360 #else | |
361 return event_->GetKeyCode(); | |
362 #endif | |
363 } | |
364 | |
365 #if defined(OS_WIN) | |
366 bool Textfield::Keystroke::IsControlHeld() const { | |
367 return base::win::IsCtrlPressed(); | |
368 } | |
369 | |
370 bool Textfield::Keystroke::IsShiftHeld() const { | |
371 return base::win::IsShiftPressed(); | |
372 } | |
373 #else | |
374 bool Textfield::Keystroke::IsControlHeld() const { | |
375 return event_->IsControlDown(); | |
376 } | |
377 | |
378 bool Textfield::Keystroke::IsShiftHeld() const { | |
379 return event_->IsShiftDown(); | |
380 } | |
381 #endif | |
382 | |
383 } // namespace views | 357 } // namespace views |
OLD | NEW |