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

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

Issue 11308322: events: Start changing EventHandler interface to not return a value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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/focus_change_shim.cc ('k') | ui/views/corewm/focus_controller_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/corewm/focus_controller.h" 5 #include "ui/views/corewm/focus_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/env.h" 9 #include "ui/aura/env.h"
10 #include "ui/views/corewm/focus_change_event.h" 10 #include "ui/views/corewm/focus_change_event.h"
(...skipping 22 matching lines...) Expand all
33 int changing_event_type, 33 int changing_event_type,
34 int changed_event_type, 34 int changed_event_type,
35 aura::Window** state, 35 aura::Window** state,
36 aura::Window* new_state, 36 aura::Window* new_state,
37 bool restack, 37 bool restack,
38 ui::EventTarget** event_dispatch_target) { 38 ui::EventTarget** event_dispatch_target) {
39 int result = ui::ER_UNHANDLED; 39 int result = ui::ER_UNHANDLED;
40 { 40 {
41 base::AutoReset<ui::EventTarget*> reset(event_dispatch_target, *state); 41 base::AutoReset<ui::EventTarget*> reset(event_dispatch_target, *state);
42 FocusChangeEvent changing_event(changing_event_type); 42 FocusChangeEvent changing_event(changing_event_type);
43 result = dispatcher->ProcessEvent(*state, &changing_event); 43 dispatcher->ProcessEvent(*state, &changing_event);
44 result = changing_event.result();
44 } 45 }
45 DCHECK(!(result & ui::ER_CONSUMED)) 46 DCHECK(!(result & ui::ER_CONSUMED))
46 << "Focus and Activation events cannot be consumed"; 47 << "Focus and Activation events cannot be consumed";
47 48
48 aura::Window* lost_active = *state; 49 aura::Window* lost_active = *state;
49 *state = new_state; 50 *state = new_state;
50 51
51 if (restack && new_state) { 52 if (restack && new_state) {
52 StackTransientParentsBelowModalWindow(new_state); 53 StackTransientParentsBelowModalWindow(new_state);
53 new_state->parent()->StackChildAtTop(new_state); 54 new_state->parent()->StackChildAtTop(new_state);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 SetFocusedWindow(rules_->GetNextFocusableWindow(window)); 261 SetFocusedWindow(rules_->GetNextFocusableWindow(window));
261 } 262 }
262 } 263 }
263 264
264 void FocusController::WindowFocusedFromInputEvent(aura::Window* window) { 265 void FocusController::WindowFocusedFromInputEvent(aura::Window* window) {
265 FocusWindow(window, NULL); 266 FocusWindow(window, NULL);
266 } 267 }
267 268
268 } // namespace corewm 269 } // namespace corewm
269 } // namespace views 270 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/corewm/focus_change_shim.cc ('k') | ui/views/corewm/focus_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698