| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "third_party/skia/include/core/SkRegion.h" | 10 #include "third_party/skia/include/core/SkRegion.h" |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 //////////////////////////////////////////////////////////////////////////////// | 866 //////////////////////////////////////////////////////////////////////////////// |
| 867 // NativeWidgetAura, ui::EventHandler implementation: | 867 // NativeWidgetAura, ui::EventHandler implementation: |
| 868 | 868 |
| 869 void NativeWidgetAura::OnKeyEvent(ui::KeyEvent* event) { | 869 void NativeWidgetAura::OnKeyEvent(ui::KeyEvent* event) { |
| 870 DCHECK(window_); | 870 DCHECK(window_); |
| 871 // Renderer may send a key event back to us if the key event wasn't handled, | 871 // Renderer may send a key event back to us if the key event wasn't handled, |
| 872 // and the window may be invisible by that time. | 872 // and the window may be invisible by that time. |
| 873 if (!window_->IsVisible()) | 873 if (!window_->IsVisible()) |
| 874 return; | 874 return; |
| 875 | 875 |
| 876 FocusManager* focus_manager = GetWidget()->GetFocusManager(); | |
| 877 delegate_->OnKeyEvent(event); | 876 delegate_->OnKeyEvent(event); |
| 878 if (!event->handled() && focus_manager) | |
| 879 focus_manager->OnKeyEvent(*event); | |
| 880 event->SetHandled(); | 877 event->SetHandled(); |
| 881 } | 878 } |
| 882 | 879 |
| 883 void NativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) { | 880 void NativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) { |
| 884 DCHECK(window_); | 881 DCHECK(window_); |
| 885 DCHECK(window_->IsVisible()); | 882 DCHECK(window_->IsVisible()); |
| 886 if (event->type() == ui::ET_MOUSEWHEEL) { | 883 if (event->type() == ui::ET_MOUSEWHEEL) { |
| 887 delegate_->OnMouseEvent(event); | 884 delegate_->OnMouseEvent(event); |
| 888 if (event->handled()) | 885 if (event->handled()) |
| 889 return; | 886 return; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1167 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
| 1171 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1168 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
| 1172 return gfx::FontList(gfx::Font(caption_font.get())); | 1169 return gfx::FontList(gfx::Font(caption_font.get())); |
| 1173 #else | 1170 #else |
| 1174 return gfx::FontList(); | 1171 return gfx::FontList(); |
| 1175 #endif | 1172 #endif |
| 1176 } | 1173 } |
| 1177 | 1174 |
| 1178 } // namespace internal | 1175 } // namespace internal |
| 1179 } // namespace views | 1176 } // namespace views |
| OLD | NEW |