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/widget/native_widget_aura.h" | 5 #include "views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "ui/aura/desktop.h" | 8 #include "ui/aura/desktop.h" |
9 #include "ui/aura/event.h" | 9 #include "ui/aura/event.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 Widget* widget = GetWidget(); | 488 Widget* widget = GetWidget(); |
489 if (widget->is_top_level()) { | 489 if (widget->is_top_level()) { |
490 InputMethod* input_method = widget->GetInputMethod(); | 490 InputMethod* input_method = widget->GetInputMethod(); |
491 input_method->OnBlur(); | 491 input_method->OnBlur(); |
492 widget->GetFocusManager()->StoreFocusedView(); | 492 widget->GetFocusManager()->StoreFocusedView(); |
493 } | 493 } |
494 delegate_->OnNativeBlur(NULL); | 494 delegate_->OnNativeBlur(NULL); |
495 } | 495 } |
496 | 496 |
497 bool NativeWidgetAura::OnKeyEvent(aura::KeyEvent* event) { | 497 bool NativeWidgetAura::OnKeyEvent(aura::KeyEvent* event) { |
| 498 // TODO(beng): Need an InputMethodAura to properly handle character events. |
| 499 // Right now, we just skip these. |
| 500 if (event->is_char()) |
| 501 return false; |
| 502 |
498 DCHECK(window_->IsVisible()); | 503 DCHECK(window_->IsVisible()); |
499 InputMethod* input_method = GetWidget()->GetInputMethod(); | 504 InputMethod* input_method = GetWidget()->GetInputMethod(); |
500 DCHECK(input_method); | 505 DCHECK(input_method); |
501 // TODO(oshima): DispatchKeyEvent should return bool? | 506 // TODO(oshima): DispatchKeyEvent should return bool? |
502 KeyEvent views_event(event); | 507 KeyEvent views_event(event); |
503 input_method->DispatchKeyEvent(views_event); | 508 input_method->DispatchKeyEvent(views_event); |
504 return true; | 509 return true; |
505 } | 510 } |
506 | 511 |
507 gfx::NativeCursor NativeWidgetAura::GetCursor(const gfx::Point& point) { | 512 gfx::NativeCursor NativeWidgetAura::GetCursor(const gfx::Point& point) { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 } | 659 } |
655 | 660 |
656 // static | 661 // static |
657 bool NativeWidgetPrivate::IsMouseButtonDown() { | 662 bool NativeWidgetPrivate::IsMouseButtonDown() { |
658 NOTIMPLEMENTED(); | 663 NOTIMPLEMENTED(); |
659 return false; | 664 return false; |
660 } | 665 } |
661 | 666 |
662 } // namespace internal | 667 } // namespace internal |
663 } // namespace views | 668 } // namespace views |
OLD | NEW |