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

Side by Side Diff: ash/mus/window_manager.cc

Issue 2125883003: Adds ability for pre-target accelerators to not consume events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 5 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
« no previous file with comments | « ash/mus/window_manager.h ('k') | services/ui/demo/mus_demo.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/mus/window_manager.h" 5 #include "ash/mus/window_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 bool janky) { 223 bool janky) {
224 for (auto* window : client_windows) 224 for (auto* window : client_windows)
225 SetWindowIsJanky(window, janky); 225 SetWindowIsJanky(window, janky);
226 } 226 }
227 227
228 void WindowManager::OnWmNewDisplay(::ui::Window* window, 228 void WindowManager::OnWmNewDisplay(::ui::Window* window,
229 const display::Display& display) { 229 const display::Display& display) {
230 CreateRootWindowController(window, display); 230 CreateRootWindowController(window, display);
231 } 231 }
232 232
233 void WindowManager::OnAccelerator(uint32_t id, const ui::Event& event) {
234 switch (id) {
235 case kWindowSwitchAccelerator:
236 window_manager_client()->ActivateNextWindow();
237 break;
238 default:
239 FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
240 OnAccelerator(id, event));
241 break;
242 }
243 }
244
245 void WindowManager::OnWmPerformMoveLoop( 233 void WindowManager::OnWmPerformMoveLoop(
246 ::ui::Window* window, 234 ::ui::Window* window,
247 ::ui::mojom::MoveLoopSource source, 235 ::ui::mojom::MoveLoopSource source,
248 const gfx::Point& cursor_location, 236 const gfx::Point& cursor_location,
249 const base::Callback<void(bool)>& on_done) { 237 const base::Callback<void(bool)>& on_done) {
250 NOTIMPLEMENTED(); 238 NOTIMPLEMENTED();
251 } 239 }
252 240
253 void WindowManager::OnWmCancelMoveLoop(::ui::Window* window) { 241 void WindowManager::OnWmCancelMoveLoop(::ui::Window* window) {
254 NOTIMPLEMENTED(); 242 NOTIMPLEMENTED();
255 } 243 }
256 244
245 ui::mojom::EventResult WindowManager::OnAccelerator(uint32_t id,
246 const ui::Event& event) {
247 switch (id) {
248 case kWindowSwitchAccelerator:
249 window_manager_client()->ActivateNextWindow();
250 break;
251 default:
252 FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
253 OnAccelerator(id, event));
254 break;
255 }
256 return ui::mojom::EventResult::HANDLED;
257 }
258
257 } // namespace mus 259 } // namespace mus
258 } // namespace ash 260 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/window_manager.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698