Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1304 | 1304 |
| 1305 void WindowTreeClient::GetWindowManager( | 1305 void WindowTreeClient::GetWindowManager( |
| 1306 mojo::AssociatedInterfaceRequest<WindowManager> internal) { | 1306 mojo::AssociatedInterfaceRequest<WindowManager> internal) { |
| 1307 window_manager_internal_.reset( | 1307 window_manager_internal_.reset( |
| 1308 new mojo::AssociatedBinding<ui::mojom::WindowManager>( | 1308 new mojo::AssociatedBinding<ui::mojom::WindowManager>( |
| 1309 this, std::move(internal))); | 1309 this, std::move(internal))); |
| 1310 } | 1310 } |
| 1311 | 1311 |
| 1312 void WindowTreeClient::RequestClose(uint32_t window_id) { | 1312 void WindowTreeClient::RequestClose(uint32_t window_id) { |
| 1313 WindowMus* window = GetWindowByServerId(window_id); | 1313 WindowMus* window = GetWindowByServerId(window_id); |
| 1314 if (!window || !IsRoot(window)) | 1314 if (!window) |
| 1315 return; | 1315 return; |
| 1316 | 1316 |
| 1317 window->GetWindow()->delegate()->OnRequestClose(); | 1317 // If the window is the root window, we send close request to the entire |
| 1318 // WindowTreeHost. Otherwise we ask the delegate of the window to close it. | |
| 1319 if (IsRoot(window)) { | |
| 1320 GetWindowTreeHostMus(window->GetWindow())->OnCloseRequest(); | |
| 1321 } else { | |
| 1322 window->GetWindow()->delegate()->OnRequestClose(); | |
| 1323 } | |
|
sadrul
2017/01/04 20:08:07
Don't need {}
As discussed offline, the alternate
| |
| 1318 } | 1324 } |
| 1319 | 1325 |
| 1320 void WindowTreeClient::OnConnect(ClientSpecificId client_id) { | 1326 void WindowTreeClient::OnConnect(ClientSpecificId client_id) { |
| 1321 client_id_ = client_id; | 1327 client_id_ = client_id; |
| 1322 } | 1328 } |
| 1323 | 1329 |
| 1324 void WindowTreeClient::WmNewDisplayAdded(const display::Display& display, | 1330 void WindowTreeClient::WmNewDisplayAdded(const display::Display& display, |
| 1325 ui::mojom::WindowDataPtr root_data, | 1331 ui::mojom::WindowDataPtr root_data, |
| 1326 bool parent_drawn) { | 1332 bool parent_drawn) { |
| 1327 WmNewDisplayAddedImpl(display, std::move(root_data), parent_drawn); | 1333 WmNewDisplayAddedImpl(display, std::move(root_data), parent_drawn); |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1692 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1698 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 1693 this, capture_synchronizer_.get(), window)); | 1699 this, capture_synchronizer_.get(), window)); |
| 1694 } | 1700 } |
| 1695 | 1701 |
| 1696 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1702 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 1697 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1703 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 1698 this, focus_synchronizer_.get(), window)); | 1704 this, focus_synchronizer_.get(), window)); |
| 1699 } | 1705 } |
| 1700 | 1706 |
| 1701 } // namespace aura | 1707 } // namespace aura |
| OLD | NEW |