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/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "ui/base/event.h" | 10 #include "ui/base/event.h" |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 return non_client_view_ ? | 1056 return non_client_view_ ? |
1057 non_client_view_->NonClientHitTest(point) : | 1057 non_client_view_->NonClientHitTest(point) : |
1058 HTNOWHERE; | 1058 HTNOWHERE; |
1059 } | 1059 } |
1060 | 1060 |
1061 bool Widget::OnKeyEvent(const ui::KeyEvent& event) { | 1061 bool Widget::OnKeyEvent(const ui::KeyEvent& event) { |
1062 ScopedEvent scoped(this, event); | 1062 ScopedEvent scoped(this, event); |
1063 return static_cast<internal::RootView*>(GetRootView())->OnKeyEvent(event); | 1063 return static_cast<internal::RootView*>(GetRootView())->OnKeyEvent(event); |
1064 } | 1064 } |
1065 | 1065 |
1066 bool Widget::OnMouseEvent(const MouseEvent& event) { | 1066 bool Widget::OnMouseEvent(const ui::MouseEvent& event) { |
1067 ScopedEvent scoped(this, event); | 1067 ScopedEvent scoped(this, event); |
1068 switch (event.type()) { | 1068 switch (event.type()) { |
1069 case ui::ET_MOUSE_PRESSED: | 1069 case ui::ET_MOUSE_PRESSED: |
1070 last_mouse_event_was_move_ = false; | 1070 last_mouse_event_was_move_ = false; |
1071 // Make sure we're still visible before we attempt capture as the mouse | 1071 // Make sure we're still visible before we attempt capture as the mouse |
1072 // press processing may have made the window hide (as happens with menus). | 1072 // press processing may have made the window hide (as happens with menus). |
1073 if (GetRootView()->OnMousePressed(event) && IsVisible()) { | 1073 if (GetRootView()->OnMousePressed(event) && IsVisible()) { |
1074 is_mouse_button_pressed_ = true; | 1074 is_mouse_button_pressed_ = true; |
1075 if (!native_widget_->HasCapture()) | 1075 if (!native_widget_->HasCapture()) |
1076 native_widget_->SetCapture(); | 1076 native_widget_->SetCapture(); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 | 1328 |
1329 //////////////////////////////////////////////////////////////////////////////// | 1329 //////////////////////////////////////////////////////////////////////////////// |
1330 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1330 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1331 | 1331 |
1332 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1332 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1333 return this; | 1333 return this; |
1334 } | 1334 } |
1335 | 1335 |
1336 } // namespace internal | 1336 } // namespace internal |
1337 } // namespace views | 1337 } // namespace views |
OLD | NEW |