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

Side by Side Diff: ui/views/widget/widget.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/native_widget_aura.cc ('k') | ui/views/widget/widget_interactive_uitest.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/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 HTNOWHERE; 1155 HTNOWHERE;
1156 1156
1157 if (movement_disabled_ && (component == HTCAPTION || component == HTSYSMENU)) 1157 if (movement_disabled_ && (component == HTCAPTION || component == HTSYSMENU))
1158 return HTNOWHERE; 1158 return HTNOWHERE;
1159 1159
1160 return component; 1160 return component;
1161 } 1161 }
1162 1162
1163 void Widget::OnKeyEvent(ui::KeyEvent* event) { 1163 void Widget::OnKeyEvent(ui::KeyEvent* event) {
1164 SendEventToProcessor(event); 1164 SendEventToProcessor(event);
1165 if (!event->handled() && GetFocusManager() &&
1166 !GetFocusManager()->OnKeyEvent(*event)) {
1167 event->StopPropagation();
1168 }
1165 } 1169 }
1166 1170
1167 // TODO(tdanderson): We should not be calling the OnMouse*() functions on 1171 // TODO(tdanderson): We should not be calling the OnMouse*() functions on
1168 // RootView from anywhere in Widget. Use 1172 // RootView from anywhere in Widget. Use
1169 // SendEventToProcessor() instead. See crbug.com/348087. 1173 // SendEventToProcessor() instead. See crbug.com/348087.
1170 void Widget::OnMouseEvent(ui::MouseEvent* event) { 1174 void Widget::OnMouseEvent(ui::MouseEvent* event) {
1171 View* root_view = GetRootView(); 1175 View* root_view = GetRootView();
1172 switch (event->type()) { 1176 switch (event->type()) {
1173 case ui::ET_MOUSE_PRESSED: { 1177 case ui::ET_MOUSE_PRESSED: {
1174 last_mouse_event_was_move_ = false; 1178 last_mouse_event_was_move_ = false;
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 1491
1488 //////////////////////////////////////////////////////////////////////////////// 1492 ////////////////////////////////////////////////////////////////////////////////
1489 // internal::NativeWidgetPrivate, NativeWidget implementation: 1493 // internal::NativeWidgetPrivate, NativeWidget implementation:
1490 1494
1491 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1495 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1492 return this; 1496 return this;
1493 } 1497 }
1494 1498
1495 } // namespace internal 1499 } // namespace internal
1496 } // namespace views 1500 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura.cc ('k') | ui/views/widget/widget_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698