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

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

Issue 11570012: events: Update key-event handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-for-landing Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/widget.h ('k') | ui/views/widget/widget_unittest.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/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/events/event.h" 10 #include "ui/base/events/event.h"
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 if (native_widget_initialized_) 1104 if (native_widget_initialized_)
1105 GetRootView()->Paint(canvas); 1105 GetRootView()->Paint(canvas);
1106 } 1106 }
1107 1107
1108 int Widget::GetNonClientComponent(const gfx::Point& point) { 1108 int Widget::GetNonClientComponent(const gfx::Point& point) {
1109 return non_client_view_ ? 1109 return non_client_view_ ?
1110 non_client_view_->NonClientHitTest(point) : 1110 non_client_view_->NonClientHitTest(point) :
1111 HTNOWHERE; 1111 HTNOWHERE;
1112 } 1112 }
1113 1113
1114 bool Widget::OnKeyEvent(const ui::KeyEvent& event) { 1114 void Widget::OnKeyEvent(ui::KeyEvent* event) {
1115 ScopedEvent scoped(this, event); 1115 ScopedEvent scoped(this, *event);
1116 return static_cast<internal::RootView*>(GetRootView())-> 1116 static_cast<internal::RootView*>(GetRootView())->
1117 DispatchKeyEvent(event) != ui::ER_UNHANDLED; 1117 DispatchKeyEvent(event);
1118 } 1118 }
1119 1119
1120 bool Widget::OnMouseEvent(const ui::MouseEvent& event) { 1120 bool Widget::OnMouseEvent(const ui::MouseEvent& event) {
1121 ScopedEvent scoped(this, event); 1121 ScopedEvent scoped(this, event);
1122 switch (event.type()) { 1122 switch (event.type()) {
1123 case ui::ET_MOUSE_PRESSED: 1123 case ui::ET_MOUSE_PRESSED:
1124 last_mouse_event_was_move_ = false; 1124 last_mouse_event_was_move_ = false;
1125 // Make sure we're still visible before we attempt capture as the mouse 1125 // Make sure we're still visible before we attempt capture as the mouse
1126 // press processing may have made the window hide (as happens with menus). 1126 // press processing may have made the window hide (as happens with menus).
1127 if (GetRootView()->OnMousePressed(event) && IsVisible()) { 1127 if (GetRootView()->OnMousePressed(event) && IsVisible()) {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 1386
1387 //////////////////////////////////////////////////////////////////////////////// 1387 ////////////////////////////////////////////////////////////////////////////////
1388 // internal::NativeWidgetPrivate, NativeWidget implementation: 1388 // internal::NativeWidgetPrivate, NativeWidget implementation:
1389 1389
1390 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1390 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1391 return this; 1391 return this;
1392 } 1392 }
1393 1393
1394 } // namespace internal 1394 } // namespace internal
1395 } // namespace views 1395 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget.h ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698