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

Side by Side Diff: ui/views/mus/native_widget_mus.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 | « no previous file | ui/views/widget/desktop_aura/desktop_native_widget_aura.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/mus/native_widget_mus.h" 5 #include "ui/views/mus/native_widget_mus.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "components/mus/public/cpp/property_type_converters.h" 9 #include "components/mus/public/cpp/property_type_converters.h"
10 #include "components/mus/public/cpp/window.h" 10 #include "components/mus/public/cpp/window.h"
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 // If such object is not attached, character events might be sent (e.g. on 814 // If such object is not attached, character events might be sent (e.g. on
815 // Windows). In this case, we just skip these. 815 // Windows). In this case, we just skip these.
816 return; 816 return;
817 } 817 }
818 // Renderer may send a key event back to us if the key event wasn't handled, 818 // Renderer may send a key event back to us if the key event wasn't handled,
819 // and the window may be invisible by that time. 819 // and the window may be invisible by that time.
820 if (!content_->IsVisible()) 820 if (!content_->IsVisible())
821 return; 821 return;
822 822
823 native_widget_delegate_->OnKeyEvent(event); 823 native_widget_delegate_->OnKeyEvent(event);
824 if (event->handled())
825 return;
826
827 if (GetWidget()->HasFocusManager() &&
828 !GetWidget()->GetFocusManager()->OnKeyEvent(*event))
829 event->SetHandled();
830 } 824 }
831 825
832 void NativeWidgetMus::OnMouseEvent(ui::MouseEvent* event) { 826 void NativeWidgetMus::OnMouseEvent(ui::MouseEvent* event) {
833 // TODO(sky): forward to tooltipmanager. See NativeWidgetDesktopAura. 827 // TODO(sky): forward to tooltipmanager. See NativeWidgetDesktopAura.
834 DCHECK(content_->IsVisible()); 828 DCHECK(content_->IsVisible());
835 native_widget_delegate_->OnMouseEvent(event); 829 native_widget_delegate_->OnMouseEvent(event);
836 // WARNING: we may have been deleted. 830 // WARNING: we may have been deleted.
837 } 831 }
838 832
839 void NativeWidgetMus::OnScrollEvent(ui::ScrollEvent* event) { 833 void NativeWidgetMus::OnScrollEvent(ui::ScrollEvent* event) {
(...skipping 14 matching lines...) Expand all
854 848
855 void NativeWidgetMus::OnGestureEvent(ui::GestureEvent* event) { 849 void NativeWidgetMus::OnGestureEvent(ui::GestureEvent* event) {
856 native_widget_delegate_->OnGestureEvent(event); 850 native_widget_delegate_->OnGestureEvent(event);
857 } 851 }
858 852
859 void NativeWidgetMus::OnHostCloseRequested(const aura::WindowTreeHost* host) { 853 void NativeWidgetMus::OnHostCloseRequested(const aura::WindowTreeHost* host) {
860 GetWidget()->Close(); 854 GetWidget()->Close();
861 } 855 }
862 856
863 } // namespace views 857 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698