Chromium Code Reviews| 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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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(); | 876 FocusManager* focus_manager = GetWidget()->GetFocusManager(); |
| 877 delegate_->OnKeyEvent(event); | 877 delegate_->OnKeyEvent(event); |
| 878 if (!event->handled() && focus_manager) | 878 if (!event->handled() && focus_manager) { |
| 879 focus_manager->OnKeyEvent(*event); | 879 if (!focus_manager->OnKeyEvent(*event)) |
| 880 event->StopPropagation(); | |
| 881 } | |
|
sadrul
2016/02/17 21:17:55
Should this code just move into Widget::OnKeyEvent
Shu Chen
2016/02/18 00:29:54
Done. Good idea.
| |
| 880 event->SetHandled(); | 882 event->SetHandled(); |
| 881 } | 883 } |
| 882 | 884 |
| 883 void NativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) { | 885 void NativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) { |
| 884 DCHECK(window_); | 886 DCHECK(window_); |
| 885 DCHECK(window_->IsVisible()); | 887 DCHECK(window_->IsVisible()); |
| 886 if (event->type() == ui::ET_MOUSEWHEEL) { | 888 if (event->type() == ui::ET_MOUSEWHEEL) { |
| 887 delegate_->OnMouseEvent(event); | 889 delegate_->OnMouseEvent(event); |
| 888 if (event->handled()) | 890 if (event->handled()) |
| 889 return; | 891 return; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1170 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1172 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
| 1171 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1173 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
| 1172 return gfx::FontList(gfx::Font(caption_font.get())); | 1174 return gfx::FontList(gfx::Font(caption_font.get())); |
| 1173 #else | 1175 #else |
| 1174 return gfx::FontList(); | 1176 return gfx::FontList(); |
| 1175 #endif | 1177 #endif |
| 1176 } | 1178 } |
| 1177 | 1179 |
| 1178 } // namespace internal | 1180 } // namespace internal |
| 1179 } // namespace views | 1181 } // namespace views |
| OLD | NEW |