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 "services/ui/public/cpp/window_tree_client.h" | 5 #include "services/ui/public/cpp/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 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1309 | 1309 |
| 1310 void WindowTreeClient::WmDisplayModified(const display::Display& display) { | 1310 void WindowTreeClient::WmDisplayModified(const display::Display& display) { |
| 1311 DCHECK(window_manager_delegate_); | 1311 DCHECK(window_manager_delegate_); |
| 1312 window_manager_delegate_->OnWmDisplayModified(display); | 1312 window_manager_delegate_->OnWmDisplayModified(display); |
| 1313 } | 1313 } |
| 1314 | 1314 |
| 1315 void WindowTreeClient::WmSetBounds(uint32_t change_id, | 1315 void WindowTreeClient::WmSetBounds(uint32_t change_id, |
| 1316 Id window_id, | 1316 Id window_id, |
| 1317 const gfx::Rect& transit_bounds) { | 1317 const gfx::Rect& transit_bounds) { |
| 1318 Window* window = GetWindowByServerId(window_id); | 1318 Window* window = GetWindowByServerId(window_id); |
| 1319 bool result = false; | |
| 1320 if (window) { | 1319 if (window) { |
| 1321 DCHECK(window_manager_delegate_); | 1320 DCHECK(window_manager_delegate_); |
| 1322 gfx::Rect transit_bounds_in_dip = gfx::ConvertRectToDIP( | 1321 gfx::Rect transit_bounds_in_dip = gfx::ConvertRectToDIP( |
| 1323 ScaleFactorForDisplay(window->display_id()), transit_bounds); | 1322 ScaleFactorForDisplay(window->display_id()), transit_bounds); |
| 1324 gfx::Rect bounds = transit_bounds_in_dip; | 1323 window->SetBounds(transit_bounds_in_dip); |
|
mfomitchev
2016/12/06 20:55:20
Don't we still need to call
window_manager_delega
thanhph
2016/12/06 21:41:04
The window bound is already set here (window->SetB
mfomitchev
2016/12/06 21:57:11
window_manager_delegate_ (which is ash::mus::Windo
thanhph
2016/12/07 20:48:12
Done, thanks! I added this back in the new cl.
| |
| 1325 result = window_manager_delegate_->OnWmSetBounds(window, &bounds); | |
| 1326 if (result) { | |
| 1327 // If the resulting bounds differ return false. Returning false ensures | |
| 1328 // the client applies the bounds we set below. | |
| 1329 result = bounds == transit_bounds_in_dip; | |
| 1330 window->SetBounds(bounds); | |
| 1331 } | |
| 1332 } | 1324 } |
| 1333 if (window_manager_internal_client_) | 1325 if (window_manager_internal_client_) |
| 1334 window_manager_internal_client_->WmResponse(change_id, result); | 1326 window_manager_internal_client_->WmResponse(change_id, false); |
|
Fady Samuel
2016/12/06 20:50:07
I'm confused about this? Shouldn't the second argu
mfomitchev
2016/12/06 20:57:44
I think false is right here - we want the client t
thanhph
2016/12/06 21:41:04
Thanks for the reference Mikhail. Let me know if y
| |
| 1335 } | 1327 } |
| 1336 | 1328 |
| 1337 void WindowTreeClient::WmSetProperty( | 1329 void WindowTreeClient::WmSetProperty( |
| 1338 uint32_t change_id, | 1330 uint32_t change_id, |
| 1339 Id window_id, | 1331 Id window_id, |
| 1340 const std::string& name, | 1332 const std::string& name, |
| 1341 const base::Optional<std::vector<uint8_t>>& transit_data) { | 1333 const base::Optional<std::vector<uint8_t>>& transit_data) { |
| 1342 Window* window = GetWindowByServerId(window_id); | 1334 Window* window = GetWindowByServerId(window_id); |
| 1343 bool result = false; | 1335 bool result = false; |
| 1344 if (window) { | 1336 if (window) { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1477 // TODO(riajiang): Figure out if |offset| needs to be converted. | 1469 // TODO(riajiang): Figure out if |offset| needs to be converted. |
| 1478 // (http://crbugs.com/646932) | 1470 // (http://crbugs.com/646932) |
| 1479 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1471 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1480 server_id(window), offset.x(), offset.y(), | 1472 server_id(window), offset.x(), offset.y(), |
| 1481 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), | 1473 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), |
| 1482 hit_area)); | 1474 hit_area)); |
| 1483 } | 1475 } |
| 1484 } | 1476 } |
| 1485 | 1477 |
| 1486 } // namespace ui | 1478 } // namespace ui |
| OLD | NEW |