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

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

Issue 29883002: Attempt to re-land FocusManager removal from Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable test with note. Created 7 years, 2 months 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
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/activation_change_observer.h" 8 #include "ui/aura/client/activation_change_observer.h"
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 return; 172 return;
173 if (!active_window_->Contains(window)) 173 if (!active_window_->Contains(window))
174 return; 174 return;
175 SetFocusedWindow(window); 175 SetFocusedWindow(window);
176 } 176 }
177 177
178 aura::Window* FocusController::GetFocusedWindow() { 178 aura::Window* FocusController::GetFocusedWindow() {
179 return focused_window_; 179 return focused_window_;
180 } 180 }
181 181
182 void FocusController::OnWindowHiddenInRootWindow(
183 aura::Window* window,
184 aura::RootWindow* root_window,
185 bool destroyed) {
186 //NOTREACHED();
187 // This method is only for compat with aura::FocusManager. It should not be
188 // needed in the new FocusController.
189 }
190
191 //////////////////////////////////////////////////////////////////////////////// 182 ////////////////////////////////////////////////////////////////////////////////
192 // FocusController, ui::EventHandler implementation: 183 // FocusController, ui::EventHandler implementation:
193 void FocusController::OnKeyEvent(ui::KeyEvent* event) { 184 void FocusController::OnKeyEvent(ui::KeyEvent* event) {
194 } 185 }
195 186
196 void FocusController::OnMouseEvent(ui::MouseEvent* event) { 187 void FocusController::OnMouseEvent(ui::MouseEvent* event) {
197 if (event->type() == ui::ET_MOUSE_PRESSED) 188 if (event->type() == ui::ET_MOUSE_PRESSED)
198 WindowFocusedFromInputEvent(static_cast<aura::Window*>(event->target())); 189 WindowFocusedFromInputEvent(static_cast<aura::Window*>(event->target()));
199 } 190 }
200 191
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 void FocusController::WindowFocusedFromInputEvent(aura::Window* window) { 343 void FocusController::WindowFocusedFromInputEvent(aura::Window* window) {
353 // Only focus |window| if it or any of its parents can be focused. Otherwise 344 // Only focus |window| if it or any of its parents can be focused. Otherwise
354 // FocusWindow() will focus the topmost window, which may not be the 345 // FocusWindow() will focus the topmost window, which may not be the
355 // currently focused one. 346 // currently focused one.
356 if (rules_->CanFocusWindow(GetToplevelWindow(window))) 347 if (rules_->CanFocusWindow(GetToplevelWindow(window)))
357 FocusWindow(window); 348 FocusWindow(window);
358 } 349 }
359 350
360 } // namespace corewm 351 } // namespace corewm
361 } // namespace views 352 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/corewm/focus_controller.h ('k') | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698