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

Side by Side Diff: ui/views/corewm/window_modality_controller.cc

Issue 11568006: events: Update scroll and touch handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self-nit 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/corewm/window_modality_controller.h ('k') | ui/views/view.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 "ui/views/corewm/window_modality_controller.h" 5 #include "ui/views/corewm/window_modality_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/client/capture_client.h" 10 #include "ui/aura/client/capture_client.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 aura::Window* target = static_cast<aura::Window*>(event->target()); 107 aura::Window* target = static_cast<aura::Window*>(event->target());
108 return GetModalTransient(target) ? ui::ER_CONSUMED : ui::ER_UNHANDLED; 108 return GetModalTransient(target) ? ui::ER_CONSUMED : ui::ER_UNHANDLED;
109 } 109 }
110 110
111 ui::EventResult WindowModalityController::OnMouseEvent(ui::MouseEvent* event) { 111 ui::EventResult WindowModalityController::OnMouseEvent(ui::MouseEvent* event) {
112 aura::Window* target = static_cast<aura::Window*>(event->target()); 112 aura::Window* target = static_cast<aura::Window*>(event->target());
113 return ProcessLocatedEvent(target, event) ? ui::ER_CONSUMED : 113 return ProcessLocatedEvent(target, event) ? ui::ER_CONSUMED :
114 ui::ER_UNHANDLED; 114 ui::ER_UNHANDLED;
115 } 115 }
116 116
117 ui::EventResult WindowModalityController::OnTouchEvent(ui::TouchEvent* event) { 117 void WindowModalityController::OnTouchEvent(ui::TouchEvent* event) {
118 aura::Window* target = static_cast<aura::Window*>(event->target()); 118 aura::Window* target = static_cast<aura::Window*>(event->target());
119 return ProcessLocatedEvent(target, event) ? ui::ER_CONSUMED : 119 if (ProcessLocatedEvent(target, event))
120 ui::ER_UNHANDLED; 120 event->StopPropagation();
121 } 121 }
122 122
123 void WindowModalityController::OnWindowInitialized(aura::Window* window) { 123 void WindowModalityController::OnWindowInitialized(aura::Window* window) {
124 windows_.push_back(window); 124 windows_.push_back(window);
125 window->AddObserver(this); 125 window->AddObserver(this);
126 } 126 }
127 127
128 void WindowModalityController::OnWindowVisibilityChanged( 128 void WindowModalityController::OnWindowVisibilityChanged(
129 aura::Window* window, 129 aura::Window* window,
130 bool visible) { 130 bool visible) {
(...skipping 17 matching lines...) Expand all
148 aura::Window* modal_transient_child = GetModalTransient(target); 148 aura::Window* modal_transient_child = GetModalTransient(target);
149 if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || 149 if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED ||
150 event->type() == ui::ET_TOUCH_PRESSED)) { 150 event->type() == ui::ET_TOUCH_PRESSED)) {
151 AnimateWindow(modal_transient_child, WINDOW_ANIMATION_TYPE_BOUNCE); 151 AnimateWindow(modal_transient_child, WINDOW_ANIMATION_TYPE_BOUNCE);
152 } 152 }
153 return !!modal_transient_child; 153 return !!modal_transient_child;
154 } 154 }
155 155
156 } // namespace corewm 156 } // namespace corewm
157 } // namespace views 157 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/corewm/window_modality_controller.h ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698