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

Side by Side Diff: ash/wm/toplevel_window_event_handler.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 | « ash/wm/toplevel_window_event_handler.h ('k') | ash/wm/user_activity_detector.h » ('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 "ash/wm/toplevel_window_event_handler.h" 5 #include "ash/wm/toplevel_window_event_handler.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/property_util.h" 8 #include "ash/wm/property_util.h"
9 #include "ash/wm/resize_shadow_controller.h" 9 #include "ash/wm/resize_shadow_controller.h"
10 #include "ash/wm/window_resizer.h" 10 #include "ash/wm/window_resizer.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 owner->AddPreTargetHandler(this); 116 owner->AddPreTargetHandler(this);
117 owner->AddPostTargetHandler(this); 117 owner->AddPostTargetHandler(this);
118 } 118 }
119 119
120 ToplevelWindowEventHandler::~ToplevelWindowEventHandler() { 120 ToplevelWindowEventHandler::~ToplevelWindowEventHandler() {
121 Shell::GetInstance()->display_controller()->RemoveObserver(this); 121 Shell::GetInstance()->display_controller()->RemoveObserver(this);
122 if (destroyed_) 122 if (destroyed_)
123 *destroyed_ = true; 123 *destroyed_ = true;
124 } 124 }
125 125
126 ui::EventResult ToplevelWindowEventHandler::OnKeyEvent(ui::KeyEvent* event) { 126 void ToplevelWindowEventHandler::OnKeyEvent(ui::KeyEvent* event) {
127 if (window_resizer_.get() && event->type() == ui::ET_KEY_PRESSED && 127 if (window_resizer_.get() && event->type() == ui::ET_KEY_PRESSED &&
128 event->key_code() == ui::VKEY_ESCAPE) { 128 event->key_code() == ui::VKEY_ESCAPE) {
129 CompleteDrag(DRAG_REVERT, event->flags()); 129 CompleteDrag(DRAG_REVERT, event->flags());
130 } 130 }
131 return ui::ER_UNHANDLED;
132 } 131 }
133 132
134 ui::EventResult ToplevelWindowEventHandler::OnMouseEvent( 133 ui::EventResult ToplevelWindowEventHandler::OnMouseEvent(
135 ui::MouseEvent* event) { 134 ui::MouseEvent* event) {
136 if ((event->flags() & 135 if ((event->flags() &
137 (ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON)) != 0) 136 (ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON)) != 0)
138 return ui::ER_UNHANDLED; 137 return ui::ER_UNHANDLED;
139 138
140 aura::Window* target = static_cast<aura::Window*>(event->target()); 139 aura::Window* target = static_cast<aura::Window*>(event->target());
141 switch (event->type()) { 140 switch (event->type()) {
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { 435 void ToplevelWindowEventHandler::ResizerWindowDestroyed() {
437 // We explicitly don't invoke RevertDrag() since that may do things to window. 436 // We explicitly don't invoke RevertDrag() since that may do things to window.
438 // Instead we destroy the resizer. 437 // Instead we destroy the resizer.
439 window_resizer_.reset(); 438 window_resizer_.reset();
440 439
441 // End the move loop. This does nothing if we're not in a move loop. 440 // End the move loop. This does nothing if we're not in a move loop.
442 EndMoveLoop(); 441 EndMoveLoop();
443 } 442 }
444 443
445 } // namespace ash 444 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/toplevel_window_event_handler.h ('k') | ash/wm/user_activity_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698