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

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

Issue 2761233003: Adds ability for accelerators to add key/value pairs to KeyEvent (Closed)
Patch Set: feedback and compile Created 3 years, 9 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_internal.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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 handler->AttemptToStartDrag(cursor_location, HTCAPTION, aura_source, on_done); 427 handler->AttemptToStartDrag(cursor_location, HTCAPTION, aura_source, on_done);
428 } 428 }
429 429
430 void WindowManager::OnWmCancelMoveLoop(aura::Window* window) { 430 void WindowManager::OnWmCancelMoveLoop(aura::Window* window) {
431 WmWindow* child_window = WmWindow::Get(window); 431 WmWindow* child_window = WmWindow::Get(window);
432 MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window); 432 MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window);
433 if (handler) 433 if (handler)
434 handler->RevertDrag(); 434 handler->RevertDrag();
435 } 435 }
436 436
437 ui::mojom::EventResult WindowManager::OnAccelerator(uint32_t id, 437 ui::mojom::EventResult WindowManager::OnAccelerator(
438 const ui::Event& event) { 438 uint32_t id,
439 const ui::Event& event,
440 std::unordered_map<std::string, std::vector<uint8_t>>* properties) {
439 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id)); 441 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id));
440 if (iter == accelerator_handlers_.end()) 442 if (iter == accelerator_handlers_.end())
441 return ui::mojom::EventResult::HANDLED; 443 return ui::mojom::EventResult::HANDLED;
442 444
443 return iter->second->OnAccelerator(id, event); 445 return iter->second->OnAccelerator(id, event, properties);
444 } 446 }
445 447
446 void WindowManager::OnWmSetClientArea( 448 void WindowManager::OnWmSetClientArea(
447 aura::Window* window, 449 aura::Window* window,
448 const gfx::Insets& insets, 450 const gfx::Insets& insets,
449 const std::vector<gfx::Rect>& additional_client_areas) { 451 const std::vector<gfx::Rect>& additional_client_areas) {
450 NonClientFrameController* non_client_frame_controller = 452 NonClientFrameController* non_client_frame_controller =
451 NonClientFrameController::Get(window); 453 NonClientFrameController::Get(window);
452 if (!non_client_frame_controller) 454 if (!non_client_frame_controller)
453 return; 455 return;
454 non_client_frame_controller->SetClientArea(insets, additional_client_areas); 456 non_client_frame_controller->SetClientArea(insets, additional_client_areas);
455 } 457 }
456 458
457 bool WindowManager::IsWindowActive(aura::Window* window) { 459 bool WindowManager::IsWindowActive(aura::Window* window) {
458 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window; 460 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window;
459 } 461 }
460 462
461 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { 463 void WindowManager::OnWmDeactivateWindow(aura::Window* window) {
462 Shell::GetInstance()->activation_client()->DeactivateWindow(window); 464 Shell::GetInstance()->activation_client()->DeactivateWindow(window);
463 } 465 }
464 466
465 } // namespace mus 467 } // namespace mus
466 } // namespace ash 468 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/window_manager.h ('k') | services/ui/demo/mus_demo_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698