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

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

Issue 2905893002: chromeos: convert more ash/wm code to aura::Window (Closed)
Patch Set: moar cleanup Created 3 years, 7 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
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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 display_lock.reset(); 519 display_lock.reset();
520 for (display::DisplayObserver& observer : *(display_list.observers())) 520 for (display::DisplayObserver& observer : *(display_list.observers()))
521 observer.OnDisplayMetricsChanged(display, display_changed_values); 521 observer.OnDisplayMetricsChanged(display, display_changed_values);
522 } 522 }
523 523
524 void WindowManager::OnWmPerformMoveLoop( 524 void WindowManager::OnWmPerformMoveLoop(
525 aura::Window* window, 525 aura::Window* window,
526 ui::mojom::MoveLoopSource source, 526 ui::mojom::MoveLoopSource source,
527 const gfx::Point& cursor_location, 527 const gfx::Point& cursor_location,
528 const base::Callback<void(bool)>& on_done) { 528 const base::Callback<void(bool)>& on_done) {
529 WmWindow* child_window = WmWindow::Get(window); 529 MoveEventHandler* handler = MoveEventHandler::GetForWindow(window);
530 MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window);
531 if (!handler) { 530 if (!handler) {
532 on_done.Run(false); 531 on_done.Run(false);
533 return; 532 return;
534 } 533 }
535 534
536 DCHECK(!handler->IsDragInProgress()); 535 DCHECK(!handler->IsDragInProgress());
537 aura::client::WindowMoveSource aura_source = 536 aura::client::WindowMoveSource aura_source =
538 source == ui::mojom::MoveLoopSource::MOUSE 537 source == ui::mojom::MoveLoopSource::MOUSE
539 ? aura::client::WINDOW_MOVE_SOURCE_MOUSE 538 ? aura::client::WINDOW_MOVE_SOURCE_MOUSE
540 : aura::client::WINDOW_MOVE_SOURCE_TOUCH; 539 : aura::client::WINDOW_MOVE_SOURCE_TOUCH;
541 handler->AttemptToStartDrag(cursor_location, HTCAPTION, aura_source, on_done); 540 handler->AttemptToStartDrag(cursor_location, HTCAPTION, aura_source, on_done);
542 } 541 }
543 542
544 void WindowManager::OnWmCancelMoveLoop(aura::Window* window) { 543 void WindowManager::OnWmCancelMoveLoop(aura::Window* window) {
545 WmWindow* child_window = WmWindow::Get(window); 544 MoveEventHandler* handler = MoveEventHandler::GetForWindow(window);
546 MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window);
547 if (handler) 545 if (handler)
548 handler->RevertDrag(); 546 handler->RevertDrag();
549 } 547 }
550 548
551 ui::mojom::EventResult WindowManager::OnAccelerator( 549 ui::mojom::EventResult WindowManager::OnAccelerator(
552 uint32_t id, 550 uint32_t id,
553 const ui::Event& event, 551 const ui::Event& event,
554 std::unordered_map<std::string, std::vector<uint8_t>>* properties) { 552 std::unordered_map<std::string, std::vector<uint8_t>>* properties) {
555 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id)); 553 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id));
556 if (iter == accelerator_handlers_.end()) 554 if (iter == accelerator_handlers_.end())
(...skipping 16 matching lines...) Expand all
573 bool WindowManager::IsWindowActive(aura::Window* window) { 571 bool WindowManager::IsWindowActive(aura::Window* window) {
574 return Shell::Get()->activation_client()->GetActiveWindow() == window; 572 return Shell::Get()->activation_client()->GetActiveWindow() == window;
575 } 573 }
576 574
577 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { 575 void WindowManager::OnWmDeactivateWindow(aura::Window* window) {
578 Shell::Get()->activation_client()->DeactivateWindow(window); 576 Shell::Get()->activation_client()->DeactivateWindow(window);
579 } 577 }
580 578
581 } // namespace mus 579 } // namespace mus
582 } // namespace ash 580 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698