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

Side by Side Diff: views/controls/textfield/native_textfield_gtk.cc

Issue 6675005: Integrate the new input method API for Views into Chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add some DCHECKs. Created 9 years, 9 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 <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
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(); 437 TextfieldController* controller = textfield_->GetController();
434 if (controller) 438 if (controller)
435 controller->ContentsChanged(textfield_, GetText()); 439 controller->ContentsChanged(textfield_, GetText());
oshima 2011/03/22 01:50:39 don't you have to remove this?
James Su 2011/03/22 08:41:14 Done.
436 textfield_->GetWidget()->NotifyAccessibilityEvent( 440 textfield_->GetWidget()->NotifyAccessibilityEvent(
437 textfield_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true); 441 textfield_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true);
438 return false; 442 return false;
439 } 443 }
440 444
441 // static 445 // static
442 gboolean NativeTextfieldGtk::OnMoveCursorHandler( 446 gboolean NativeTextfieldGtk::OnMoveCursorHandler(
443 GtkWidget* widget, 447 GtkWidget* widget,
444 GtkMovementStep step, 448 GtkMovementStep step,
445 gint count, 449 gint count,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 // static 525 // static
522 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 526 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
523 Textfield* field) { 527 Textfield* field) {
524 if (NativeTextfieldViews::IsTextfieldViewsEnabled()) { 528 if (NativeTextfieldViews::IsTextfieldViewsEnabled()) {
525 return new NativeTextfieldViews(field); 529 return new NativeTextfieldViews(field);
526 } 530 }
527 return new NativeTextfieldGtk(field); 531 return new NativeTextfieldGtk(field);
528 } 532 }
529 533
530 } // namespace views 534 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698