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

Unified Diff: services/ui/public/cpp/window_tree_client.cc

Issue 2548513002: Update bool WindowManager::OnWmSetBounds() to match with its desirable behavior. (Closed)
Patch Set: Change gfx::Rect* to const gfx::Rect&. Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: services/ui/public/cpp/window_tree_client.cc
diff --git a/services/ui/public/cpp/window_tree_client.cc b/services/ui/public/cpp/window_tree_client.cc
index d708659579205421d5a12514b49c8d8151ff75d5..7cd05e3bb5e7ac5d4391d915784c3e37efda7f66 100644
--- a/services/ui/public/cpp/window_tree_client.cc
+++ b/services/ui/public/cpp/window_tree_client.cc
@@ -1316,22 +1316,17 @@ void WindowTreeClient::WmSetBounds(uint32_t change_id,
Id window_id,
const gfx::Rect& transit_bounds) {
Window* window = GetWindowByServerId(window_id);
- bool result = false;
if (window) {
DCHECK(window_manager_delegate_);
gfx::Rect transit_bounds_in_dip = gfx::ConvertRectToDIP(
ScaleFactorForDisplay(window->display_id()), transit_bounds);
- gfx::Rect bounds = transit_bounds_in_dip;
- result = window_manager_delegate_->OnWmSetBounds(window, &bounds);
- if (result) {
- // If the resulting bounds differ return false. Returning false ensures
- // the client applies the bounds we set below.
- result = bounds == transit_bounds_in_dip;
- window->SetBounds(bounds);
- }
+ window_manager_delegate_->OnWmSetBounds(window, transit_bounds_in_dip);
+ 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.
}
+
+ // 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.
if (window_manager_internal_client_)
- window_manager_internal_client_->WmResponse(change_id, result);
+ window_manager_internal_client_->WmResponse(change_id, false);
}
void WindowTreeClient::WmSetProperty(

Powered by Google App Engine
This is Rietveld 408576698