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

Side by Side Diff: ui/aura/mus/window_tree_client.cc

Issue 2568303006: aura-mus: Implement Deactivate(). (Closed)
Patch Set: Add comment. Created 3 years, 11 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 | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/mus/window_tree_host_mus.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/aura/mus/window_tree_client.h" 5 #include "ui/aura/mus/window_tree_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 1459
1460 void WindowTreeClient::WmCancelMoveLoop(uint32_t change_id) { 1460 void WindowTreeClient::WmCancelMoveLoop(uint32_t change_id) {
1461 if (!window_manager_delegate_ || change_id != current_wm_move_loop_change_) 1461 if (!window_manager_delegate_ || change_id != current_wm_move_loop_change_)
1462 return; 1462 return;
1463 1463
1464 WindowMus* window = GetWindowByServerId(current_wm_move_loop_window_id_); 1464 WindowMus* window = GetWindowByServerId(current_wm_move_loop_window_id_);
1465 if (window) 1465 if (window)
1466 window_manager_delegate_->OnWmCancelMoveLoop(window->GetWindow()); 1466 window_manager_delegate_->OnWmCancelMoveLoop(window->GetWindow());
1467 } 1467 }
1468 1468
1469 void WindowTreeClient::WmDeactivateWindow(Id window_id) {
1470 if (!window_manager_delegate_)
1471 return;
1472
1473 WindowMus* window = GetWindowByServerId(window_id);
1474 if (!window) {
1475 DVLOG(1) << "Attempt to deactivate invalid window " << window_id;
1476 return;
1477 }
1478
1479 if (!window_manager_delegate_->IsWindowActive(window->GetWindow())) {
1480 DVLOG(1) << "Non-active window requested deactivation.";
1481 return;
1482 }
1483
1484 window_manager_delegate_->OnWmDeactivateWindow(window->GetWindow());
1485 }
1486
1469 void WindowTreeClient::OnAccelerator(uint32_t ack_id, 1487 void WindowTreeClient::OnAccelerator(uint32_t ack_id,
1470 uint32_t accelerator_id, 1488 uint32_t accelerator_id,
1471 std::unique_ptr<ui::Event> event) { 1489 std::unique_ptr<ui::Event> event) {
1472 DCHECK(event); 1490 DCHECK(event);
1473 const ui::mojom::EventResult result = 1491 const ui::mojom::EventResult result =
1474 window_manager_delegate_->OnAccelerator(accelerator_id, *event.get()); 1492 window_manager_delegate_->OnAccelerator(accelerator_id, *event.get());
1475 if (ack_id && window_manager_internal_client_) 1493 if (ack_id && window_manager_internal_client_)
1476 window_manager_internal_client_->OnAcceleratorAck(ack_id, result); 1494 window_manager_internal_client_->OnAcceleratorAck(ack_id, result);
1477 } 1495 }
1478 1496
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 base::Optional<gfx::Rect> out_rect = base::nullopt; 1597 base::Optional<gfx::Rect> out_rect = base::nullopt;
1580 if (mask_rect) { 1598 if (mask_rect) {
1581 out_rect = gfx::ConvertRectToPixel(ScaleFactorForDisplay(window), 1599 out_rect = gfx::ConvertRectToPixel(ScaleFactorForDisplay(window),
1582 mask_rect.value()); 1600 mask_rect.value());
1583 } 1601 }
1584 1602
1585 tree_->SetHitTestMask(WindowMus::Get(window_tree_host->window())->server_id(), 1603 tree_->SetHitTestMask(WindowMus::Get(window_tree_host->window())->server_id(),
1586 out_rect); 1604 out_rect);
1587 } 1605 }
1588 1606
1607 void WindowTreeClient::OnWindowTreeHostDeactivateWindow(
1608 WindowTreeHostMus* window_tree_host) {
1609 tree_->DeactivateWindow(
1610 WindowMus::Get(window_tree_host->window())->server_id());
1611 }
1612
1589 std::unique_ptr<WindowPortMus> WindowTreeClient::CreateWindowPortForTopLevel( 1613 std::unique_ptr<WindowPortMus> WindowTreeClient::CreateWindowPortForTopLevel(
1590 const std::map<std::string, std::vector<uint8_t>>* properties) { 1614 const std::map<std::string, std::vector<uint8_t>>* properties) {
1591 std::unique_ptr<WindowPortMus> window_port = 1615 std::unique_ptr<WindowPortMus> window_port =
1592 base::MakeUnique<WindowPortMus>(this, WindowMusType::TOP_LEVEL); 1616 base::MakeUnique<WindowPortMus>(this, WindowMusType::TOP_LEVEL);
1593 roots_.insert(window_port.get()); 1617 roots_.insert(window_port.get());
1594 1618
1595 window_port->set_server_id(MakeTransportId(client_id_, next_window_id_++)); 1619 window_port->set_server_id(MakeTransportId(client_id_, next_window_id_++));
1596 RegisterWindowMus(window_port.get()); 1620 RegisterWindowMus(window_port.get());
1597 1621
1598 std::unordered_map<std::string, std::vector<uint8_t>> transport_properties; 1622 std::unordered_map<std::string, std::vector<uint8_t>> transport_properties;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( 1717 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>(
1694 this, capture_synchronizer_.get(), window)); 1718 this, capture_synchronizer_.get(), window));
1695 } 1719 }
1696 1720
1697 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { 1721 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) {
1698 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( 1722 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>(
1699 this, focus_synchronizer_.get(), window)); 1723 this, focus_synchronizer_.get(), window));
1700 } 1724 }
1701 1725
1702 } // namespace aura 1726 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/mus/window_tree_host_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698