| OLD | NEW |
| 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/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 aura::client::SetEventClient(root_window, event_client_.get()); | 1171 aura::client::SetEventClient(root_window, event_client_.get()); |
| 1172 | 1172 |
| 1173 aura::client::SetWindowMoveClient(root_window, | 1173 aura::client::SetWindowMoveClient(root_window, |
| 1174 toplevel_window_event_handler_.get()); | 1174 toplevel_window_event_handler_.get()); |
| 1175 root_window->AddPreTargetHandler(toplevel_window_event_handler_.get()); | 1175 root_window->AddPreTargetHandler(toplevel_window_event_handler_.get()); |
| 1176 root_window->AddPostTargetHandler(toplevel_window_event_handler_.get()); | 1176 root_window->AddPostTargetHandler(toplevel_window_event_handler_.get()); |
| 1177 } | 1177 } |
| 1178 | 1178 |
| 1179 bool Shell::CanWindowReceiveEvents(aura::Window* window) { | 1179 bool Shell::CanWindowReceiveEvents(aura::Window* window) { |
| 1180 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 1180 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| 1181 for (RootWindowControllerList::iterator iter = controllers.begin(); | 1181 for (RootWindowController* controller : controllers) { |
| 1182 iter != controllers.end(); ++iter) { | 1182 if (controller->CanWindowReceiveEvents(window)) |
| 1183 SystemModalContainerLayoutManager* layout_manager = | |
| 1184 (*iter)->GetSystemModalLayoutManager(window); | |
| 1185 if (layout_manager && layout_manager->CanWindowReceiveEvents(window)) | |
| 1186 return true; | |
| 1187 // Allow events to fall through to the virtual keyboard even if displaying | |
| 1188 // a system modal dialog. | |
| 1189 if ((*iter)->IsVirtualKeyboardWindow(window)) | |
| 1190 return true; | 1183 return true; |
| 1191 } | 1184 } |
| 1192 | |
| 1193 return false; | 1185 return false; |
| 1194 } | 1186 } |
| 1195 | 1187 |
| 1196 //////////////////////////////////////////////////////////////////////////////// | 1188 //////////////////////////////////////////////////////////////////////////////// |
| 1197 // Shell, ui::EventTarget overrides: | 1189 // Shell, ui::EventTarget overrides: |
| 1198 | 1190 |
| 1199 bool Shell::CanAcceptEvent(const ui::Event& event) { | 1191 bool Shell::CanAcceptEvent(const ui::Event& event) { |
| 1200 return true; | 1192 return true; |
| 1201 } | 1193 } |
| 1202 | 1194 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1218 | 1210 |
| 1219 void Shell::OnWindowActivated( | 1211 void Shell::OnWindowActivated( |
| 1220 aura::client::ActivationChangeObserver::ActivationReason reason, | 1212 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1221 aura::Window* gained_active, | 1213 aura::Window* gained_active, |
| 1222 aura::Window* lost_active) { | 1214 aura::Window* lost_active) { |
| 1223 if (gained_active) | 1215 if (gained_active) |
| 1224 target_root_window_ = gained_active->GetRootWindow(); | 1216 target_root_window_ = gained_active->GetRootWindow(); |
| 1225 } | 1217 } |
| 1226 | 1218 |
| 1227 } // namespace ash | 1219 } // namespace ash |
| OLD | NEW |