| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |