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

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 1703683003: The key event should be stopped propagation when it's been processed as an accelerator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CQ green. Created 4 years, 10 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
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698