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

Side by Side Diff: ui/aura/window.cc

Issue 2583873002: Correctly update the popup window position (Closed)
Patch Set: test added Created 3 years, 11 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 SetBoundsInternal(final_bounds); 306 SetBoundsInternal(final_bounds);
307 } 307 }
308 } 308 }
309 309
310 void Window::SetBoundsInScreen(const gfx::Rect& new_bounds_in_screen, 310 void Window::SetBoundsInScreen(const gfx::Rect& new_bounds_in_screen,
311 const display::Display& dst_display) { 311 const display::Display& dst_display) {
312 Window* root = GetRootWindow(); 312 Window* root = GetRootWindow();
313 if (root) { 313 if (root) {
314 aura::client::ScreenPositionClient* screen_position_client = 314 aura::client::ScreenPositionClient* screen_position_client =
315 aura::client::GetScreenPositionClient(root); 315 aura::client::GetScreenPositionClient(root);
316 screen_position_client->SetBounds(this, new_bounds_in_screen, dst_display); 316 if (screen_position_client) {
317 return; 317 screen_position_client->SetBounds(this, new_bounds_in_screen,
318 dst_display);
319 return;
320 }
318 } 321 }
319 SetBounds(new_bounds_in_screen); 322 SetBounds(new_bounds_in_screen);
320 } 323 }
321 324
322 gfx::Rect Window::GetTargetBounds() const { 325 gfx::Rect Window::GetTargetBounds() const {
323 return layer() ? layer()->GetTargetBounds() : bounds(); 326 return layer() ? layer()->GetTargetBounds() : bounds();
324 } 327 }
325 328
326 void Window::SchedulePaintInRect(const gfx::Rect& rect) { 329 void Window::SchedulePaintInRect(const gfx::Rect& rect) {
327 layer()->SchedulePaint(rect); 330 layer()->SchedulePaint(rect);
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 layer_name = "Unnamed Window"; 1118 layer_name = "Unnamed Window";
1116 1119
1117 if (id_ != -1) 1120 if (id_ != -1)
1118 layer_name += " " + base::IntToString(id_); 1121 layer_name += " " + base::IntToString(id_);
1119 1122
1120 layer()->set_name(layer_name); 1123 layer()->set_name(layer_name);
1121 #endif 1124 #endif
1122 } 1125 }
1123 1126
1124 } // namespace aura 1127 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698