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_manager_delegate_->OnWmSetBounds(window, transit_bounds_in_dip); |
| 1325 result = window_manager_delegate_->OnWmSetBounds(window, &bounds); | 1324 window->SetBounds(transit_bounds_in_dip); |
|
mfomitchev
2016/12/07 20:59:46
This is wrong - we are overwriting the bounds set
thanhph
2016/12/08 00:20:29
Done.
| |
| 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 } | 1325 } |
| 1326 | |
| 1327 // Returning false ensures the client applies the bounds we set below. | |
|
mfomitchev
2016/12/07 20:59:46
We are not setting any bounds below :)
We are sett
thanhph
2016/12/08 00:20:29
Done, I removed the comment.
| |
| 1333 if (window_manager_internal_client_) | 1328 if (window_manager_internal_client_) |
| 1334 window_manager_internal_client_->WmResponse(change_id, result); | 1329 window_manager_internal_client_->WmResponse(change_id, false); |
| 1335 } | 1330 } |
| 1336 | 1331 |
| 1337 void WindowTreeClient::WmSetProperty( | 1332 void WindowTreeClient::WmSetProperty( |
| 1338 uint32_t change_id, | 1333 uint32_t change_id, |
| 1339 Id window_id, | 1334 Id window_id, |
| 1340 const std::string& name, | 1335 const std::string& name, |
| 1341 const base::Optional<std::vector<uint8_t>>& transit_data) { | 1336 const base::Optional<std::vector<uint8_t>>& transit_data) { |
| 1342 Window* window = GetWindowByServerId(window_id); | 1337 Window* window = GetWindowByServerId(window_id); |
| 1343 bool result = false; | 1338 bool result = false; |
| 1344 if (window) { | 1339 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. | 1472 // TODO(riajiang): Figure out if |offset| needs to be converted. |
| 1478 // (http://crbugs.com/646932) | 1473 // (http://crbugs.com/646932) |
| 1479 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1474 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1480 server_id(window), offset.x(), offset.y(), | 1475 server_id(window), offset.x(), offset.y(), |
| 1481 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), | 1476 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), |
| 1482 hit_area)); | 1477 hit_area)); |
| 1483 } | 1478 } |
| 1484 } | 1479 } |
| 1485 | 1480 |
| 1486 } // namespace ui | 1481 } // namespace ui |
| OLD | NEW |