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 <gdk/gdkkeysyms.h> | 5 #include <gdk/gdkkeysyms.h> |
6 #include <gtk/gtk.h> | 6 #include <gtk/gtk.h> |
7 | 7 |
8 #include "views/controls/textfield/native_textfield_gtk.h" | 8 #include "views/controls/textfield/native_textfield_gtk.h" |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 bool NativeTextfieldGtk::HandleKeyReleased(const views::KeyEvent& e) { | 369 bool NativeTextfieldGtk::HandleKeyReleased(const views::KeyEvent& e) { |
370 return false; | 370 return false; |
371 } | 371 } |
372 | 372 |
373 void NativeTextfieldGtk::HandleFocus() { | 373 void NativeTextfieldGtk::HandleFocus() { |
374 } | 374 } |
375 | 375 |
376 void NativeTextfieldGtk::HandleBlur() { | 376 void NativeTextfieldGtk::HandleBlur() { |
377 } | 377 } |
378 | 378 |
| 379 TextInputClient* NativeTextfieldGtk::GetTextInputClient() { |
| 380 return NULL; |
| 381 } |
| 382 |
379 // static | 383 // static |
380 gboolean NativeTextfieldGtk::OnKeyPressEventHandler( | 384 gboolean NativeTextfieldGtk::OnKeyPressEventHandler( |
381 GtkWidget* widget, | 385 GtkWidget* widget, |
382 GdkEventKey* event, | 386 GdkEventKey* event, |
383 NativeTextfieldGtk* textfield) { | 387 NativeTextfieldGtk* textfield) { |
384 return textfield->OnKeyPressEvent(event); | 388 return textfield->OnKeyPressEvent(event); |
385 } | 389 } |
386 | 390 |
387 gboolean NativeTextfieldGtk::OnKeyPressEvent(GdkEventKey* event) { | 391 gboolean NativeTextfieldGtk::OnKeyPressEvent(GdkEventKey* event) { |
388 TextfieldController* controller = textfield_->GetController(); | 392 TextfieldController* controller = textfield_->GetController(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 427 |
424 // static | 428 // static |
425 gboolean NativeTextfieldGtk::OnChangedHandler( | 429 gboolean NativeTextfieldGtk::OnChangedHandler( |
426 GtkWidget* widget, | 430 GtkWidget* widget, |
427 NativeTextfieldGtk* textfield) { | 431 NativeTextfieldGtk* textfield) { |
428 return textfield->OnChanged(); | 432 return textfield->OnChanged(); |
429 } | 433 } |
430 | 434 |
431 gboolean NativeTextfieldGtk::OnChanged() { | 435 gboolean NativeTextfieldGtk::OnChanged() { |
432 textfield_->SyncText(); | 436 textfield_->SyncText(); |
433 TextfieldController* controller = textfield_->GetController(); | |
434 if (controller) | |
435 controller->ContentsChanged(textfield_, GetText()); | |
436 textfield_->GetWidget()->NotifyAccessibilityEvent( | 437 textfield_->GetWidget()->NotifyAccessibilityEvent( |
437 textfield_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true); | 438 textfield_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true); |
438 return false; | 439 return false; |
439 } | 440 } |
440 | 441 |
441 // static | 442 // static |
442 gboolean NativeTextfieldGtk::OnMoveCursorHandler( | 443 gboolean NativeTextfieldGtk::OnMoveCursorHandler( |
443 GtkWidget* widget, | 444 GtkWidget* widget, |
444 GtkMovementStep step, | 445 GtkMovementStep step, |
445 gint count, | 446 gint count, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 // static | 522 // static |
522 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 523 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
523 Textfield* field) { | 524 Textfield* field) { |
524 if (NativeTextfieldViews::IsTextfieldViewsEnabled()) { | 525 if (NativeTextfieldViews::IsTextfieldViewsEnabled()) { |
525 return new NativeTextfieldViews(field); | 526 return new NativeTextfieldViews(field); |
526 } | 527 } |
527 return new NativeTextfieldGtk(field); | 528 return new NativeTextfieldGtk(field); |
528 } | 529 } |
529 | 530 |
530 } // namespace views | 531 } // namespace views |
OLD | NEW |