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 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1295 // TODO(sky): this should likely route to WindowTreeHost. | 1295 // TODO(sky): this should likely route to WindowTreeHost. |
| 1296 window_manager_delegate_->OnWmDisplayModified(display); | 1296 window_manager_delegate_->OnWmDisplayModified(display); |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 // TODO(riajiang): Convert between pixel and DIP for window bounds properly. | 1299 // TODO(riajiang): Convert between pixel and DIP for window bounds properly. |
| 1300 // (http://crbug.com/646942) | 1300 // (http://crbug.com/646942) |
| 1301 void WindowTreeClient::WmSetBounds(uint32_t change_id, | 1301 void WindowTreeClient::WmSetBounds(uint32_t change_id, |
| 1302 Id window_id, | 1302 Id window_id, |
| 1303 const gfx::Rect& transit_bounds) { | 1303 const gfx::Rect& transit_bounds) { |
| 1304 WindowMus* window = GetWindowByServerId(window_id); | 1304 WindowMus* window = GetWindowByServerId(window_id); |
| 1305 bool result = false; | |
| 1306 if (window) { | 1305 if (window) { |
| 1307 DCHECK(window_manager_delegate_); | 1306 DCHECK(window_manager_delegate_); |
| 1308 gfx::Rect bounds = transit_bounds; | |
| 1309 // TODO: this needs to trigger scheduling a bounds change on |window|. | 1307 // TODO: this needs to trigger scheduling a bounds change on |window|. |
| 1310 result = | 1308 window_manager_delegate_->OnWmSetBounds(window->GetWindow(), |
| 1311 window_manager_delegate_->OnWmSetBounds(window->GetWindow(), &bounds); | 1309 transit_bounds); |
| 1312 if (result) { | 1310 window->SetBoundsFromServer(transit_bounds); |
|
mfomitchev
2016/12/07 20:59:46
Ditto - remove
thanhph
2016/12/08 00:20:29
Done.
| |
| 1313 // If the resulting bounds differ return false. Returning false ensures | |
| 1314 // the client applies the bounds we set below. | |
| 1315 result = bounds == transit_bounds; | |
| 1316 window->SetBoundsFromServer(bounds); | |
| 1317 } | |
| 1318 } | 1311 } |
| 1319 if (window_manager_internal_client_) | 1312 if (window_manager_internal_client_) |
|
mfomitchev
2016/12/07 20:59:46
A comment similar to what you have in the Mus WTC
thanhph
2016/12/08 00:20:29
Done.
| |
| 1320 window_manager_internal_client_->WmResponse(change_id, result); | 1313 window_manager_internal_client_->WmResponse(change_id, false); |
| 1321 } | 1314 } |
| 1322 | 1315 |
| 1323 void WindowTreeClient::WmSetProperty( | 1316 void WindowTreeClient::WmSetProperty( |
| 1324 uint32_t change_id, | 1317 uint32_t change_id, |
| 1325 Id window_id, | 1318 Id window_id, |
| 1326 const std::string& name, | 1319 const std::string& name, |
| 1327 const base::Optional<std::vector<uint8_t>>& transit_data) { | 1320 const base::Optional<std::vector<uint8_t>>& transit_data) { |
| 1328 WindowMus* window = GetWindowByServerId(window_id); | 1321 WindowMus* window = GetWindowByServerId(window_id); |
| 1329 bool result = false; | 1322 bool result = false; |
| 1330 if (window) { | 1323 if (window) { |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1621 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1614 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 1622 this, capture_synchronizer_.get(), window)); | 1615 this, capture_synchronizer_.get(), window)); |
| 1623 } | 1616 } |
| 1624 | 1617 |
| 1625 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1618 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 1626 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1619 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 1627 this, focus_synchronizer_.get(), window)); | 1620 this, focus_synchronizer_.get(), window)); |
| 1628 } | 1621 } |
| 1629 | 1622 |
| 1630 } // namespace aura | 1623 } // namespace aura |
| OLD | NEW |